Support » Theme: Leaf » Move article footer meta to header

Viewing 4 replies - 1 through 4 (of 4 total)
  • tizz

    (@tizz)

    I’m not a coder too, but I can give some inputs, not a complete solution.
    First, you have to install Leaf child theme
    Then, you had to know that the interested function is
    <?php leaf_entry_meta(); ?>
    For HP, there’s no problem. You have to copy home.php in child theme and then in that copy add <?php leaf_entry_meta(); ?> where you want to display it, between title and summary:

    <h2 class="entry-title">
    <a href="<?php the_permalink(); ?> etc.
    
    <?php leaf_entry_meta(); ?>
    
    <div class="entry-summary">

    If you want a space, add < br / >.
    The HP is divided into sections, so you’ll do the same thing for each section.

    For the single post, this is more difficult, and I can’t tell you at the moment how to do. The difficulty lies in the fact that the title and content are called together in a template with

    <?php get_template_part( 'content', 'single' ); ?>

    so if you call entry_meta before that, these will end up before the title.
    The solution, I think, is to write a function or a plugin that can render entry_meta after title and before single content. That’s the part where I can’t help you.
    After that, to remove entry_meta from footer, you’ll need just a simple .entry-meta {display:none;} in custom CSS.

    iambob

    (@iambob)

    Thanks Tizz! The inserted line for the homepage placement works nice and simple, so my brain appreciates that tip.

    The follow on parts for single post changes is still a bit above my capacity even more than your own, but thanks for the additional good clues … given time I might figure it out! (I like to avoid plugins whenever possible, as so many have so much overhead cf. what a simple line or two of code can achieve).

    Appreciate helping me move forward another inch!
    Bob

    tizz

    (@tizz)

    Ops, checking what I wrote in the very last part, I realize that if you hide entry_meta with CSS in that way, it will also remove the other entries, so you’ll have to do it via template.

    Edit: with “plugin” I was referring to a specific little script, not an external one, and I agree with you in this matter.

    Solved, even for the single article page, and it’s very simple. I realized now that there’s a content-single.php file.
    Copy it into your child theme via FTP, then cut the part

    <footer class="entry-meta">
    <?php leaf_entry_meta(); ?>
    </footer><!-- .entry-meta -->

    and paste it a few lines up between

    <header class=”entry-header”>
    <h1 class=”entry-title”><?php the_title(); ?></h1>

    and

    </header><!– .entry-header –>

    So you’ll have

    <header class="entry-header">
    	<h1 class="entry-title"><?php the_title(); ?></h1>
    <footer class="entry-meta">
    <?php leaf_entry_meta(); ?>
    </footer><!-- .entry-meta -->
    		</header><!-- .entry-header -->

    That’s all.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Move article footer meta to header’ is closed to new replies.