Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Kathryn Presner

    (@zoonini)

    Hi there – I can help with that. Would you like to add the post author’s name to the blog page (homepage), on individual blog posts, or both?

    Thread Starter giuliasampogna

    (@giuliasampogna)

    Hi Kathryn

    Thanks a lot, I would like to add to the blog posts.

    Hi @giuliasampogna!

    Your first step will be to set up a child theme so you can make the necessary change without risking it being lost in a future theme update ??

    Once you have your child theme, you’ll make a copy of the parent theme’s content.php file in your child theme folder.

    In you copy, look for <div class="entry-meta"> on or around line 22. That’s the section where we’ll add your author name.

    Here’s what it looks like before making any changes:

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

    Here’s what we’re going to replace that with:

    <div class="entry-meta">
    	<?php if ( is_single() ) { ?>
    		<span class="author"><?php the_author_posts_link(); ?></span>
    	<?php }
    	sela_entry_meta(); ?>
    </div><!-- .entry-meta -->

    We’re adding a condition to check that we’re on a single blog post (not somewhere else, like the home page) and then displaying a link to a page with all of the author’s posts.

    Give that a try and let me know how it looks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add author’s name Sela’ is closed to new replies.