WordPress.org

Forums

Adding Author name to posts (5 posts)

  1. lironh
    Member
    Posted 1 year ago #

    Hi
    I'm using the coraline theme for a single-author blog.
    I would like to add the author name to each post (right next to "posted on..."), and am having a hard time figuring out how to do so. I've gone into the loop and tried changing a few things, but have had no luck, and I'm afraid to ruin something if i play around with it too much.
    The blog is located at predictivestream.com

    Any help on this would be appreciated!

  2. martcol
    Member
    Posted 1 year ago #

  3. lironh
    Member
    Posted 1 year ago #

    tried that. maybe I'm too newbie to understand - where do I put this tag? I tried to put the it into several different places in the loop, and when i did, all it did was make all of my posts disappear.
    Any other help would be appreciated.

  4. alchymyth
    Forum Moderator
    Posted 1 year ago #

    please post in your theme's forum http://wordpress.org/support/theme/coraline/#postform

    btw: the author output is already implemented in the theme, but suppressed for single-author sites;

    see in functions.php:

    /**
     * Prints HTML with meta information for the current author on multi-author blogs
     */
    function coraline_posted_by() {
    	if ( is_multi_author() && ! is_author() ) {
    		printf( __( '<span class="by-author"><span class="sep">by</span> <span class="author vcard"><a href="%1$s" title="%2$s" rel="author">%3$s</a></span> </span>', 'coraline' ),
    			esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    			esc_attr( sprintf( __( 'View all posts by %s', 'coraline' ), get_the_author_meta( 'display_name' ) ) ),
    			esc_attr( get_the_author_meta( 'display_name' ) )
    		);
    	}
    }

    simply remove this section from the conditional check:
    is_multi_author() &&
    add the edited function into functions.php of your child theme.

  5. lironh
    Member
    Posted 1 year ago #

    Works!
    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic