• Hello.

    I’ve read everything possible about how to display the author name in Sela.

    I have two authors, both with several posts and pages published.

    I am not using a child theme (and I don’t need instructions on how or why to use one, please).

    I have tried following the various instructions re pieces of code from the inc/template file, but they are – to me – not clearly phrased, and if I follow the steps as I think they are meant, my whole site dies because of invalid code.

    Can some please, please help? The site is part of a project that’s due to launch this week, and it’s been incredibly stressful getting everything to look the way I want it to.

    This is my final hurdle.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Where do you want to show the names of the authors?
    Do you have a link to the site?

    Moderator Kathryn Presner

    (@zoonini)

    Here’s one method you could try, which includes a Gist with the function code:

    https://www.ads-software.com/support/topic/meta_data-add-author-in-frontend/

    I haven’t tested it, but the other user said it worked. Let me know how it goes.

    Thread Starter nadinemuller

    (@nadinemuller)

    The site isn’t going live until the project is launched later this week, sorry.

    I simply want the author to appear under or above the date (which Sela already displays in archives, 0-)3: and posts).

    Thread Starter nadinemuller

    (@nadinemuller)

    Hi Kathryn.

    As I said above, I’ve read all those posts, and they’re not very clear at all about what code to copy exactly where to make the author meta info visible with the date meta data. It also talks about this being specific to using a child theme, which I’m not (and won’t at the moment). I’ve tried what I think the posts suggest but without details as to where *exactly* what code goes, it’s been pretty useless.

    I’m afraid I’ll need a clearer walk-through than these posts provide. One that doesn’t – this did – break the whole site.

    Thanks in advance and sorry to be a pain!

    Hi @nadinemuller,

    It will be necessary for you to create a child theme in order to achieve what you’re after.

    If you want to give the solution that Kathryn shared a go, then the first step is to copy/paste the sela_entry_meta() function from the inc/template-tags.php file to your child theme’s functions.php file:

    function sela_entry_meta() {
    	// Sticky
    	if ( is_sticky() && is_home() && ! is_paged() ) {
    		echo '<span class="featured-post">' . __( 'Featured', 'sela' ) . '</span>';
    	}
    
    	// Date
    	if ( ! is_sticky() ) {
    		sela_entry_date();
    	}
    
    	// Comments
    	if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
    		echo '<span class="comments-link">';
    		comments_popup_link( __( 'Leave a comment', 'sela' ), __( '1 Comment', 'sela' ), __( '% Comments', 'sela' ) );
    		echo '</span>';
    	}
    
    	// Edit link
    	edit_post_link( __( 'Edit', 'sela' ), '<span class="edit-link">', '</span>' );
    }

    The line to display the author’s name can be added just above // Edit link to appear just before the link to edit.

    If you don’t wish to experiment with a child theme, then you could consider a plugin to display the author’s name in a widget or similar. Here’s a list of results after searching the plugin repository for “display author:”

    https://www.ads-software.com/plugins/search.php?type=term&q=display+author

    Hope that helps!

    Thread Starter nadinemuller

    (@nadinemuller)

    Thanks so, so much Siobhan! This is much easier to follow. ?? I’ll give it a go tomorrow. Again, thanks so much!

    You’re most welcome! Let us know how you get on.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Display Author Names’ is closed to new replies.