Show author name

Mauer Themes Support Essentialist Show author name

This topic contains 3 replies, has 2 voices, and was last updated by  Paul 11 months, 2 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1555

    thepalmdiaries
    Participant

    Hi,

    Thanks for the great theme! We are just trying to set it up over at http://thepalmdiaries.com and were wondering if there was a way to display the author’s name on the blog post? E.g. just the name of the ‘author’ in wordpress, doesn’t need to be anything fancy with gravatar’s etc.

    Cheers,
    Tom

    #1576

    Paul
    Keymaster

    Hello Tom,

    To display author name on the single blog post page, please go to the functions.php file in the theme folder and add the following code at the end of the file — just before the closing ?> (see screenshot). Feel free to change ‘This post was written by ‘ text.

    if (!function_exists('mauer_append_post_author_name')) :
    
    	function mauer_append_post_author_name($content) {
    		if(is_singular() && is_main_query()) {
    			ob_start(); ?>
    			<p>This post was written by <?php the_author(); ?></p>
    			<?php $new_content = ob_get_clean();
    			$content .= $new_content;
    		}
    		return $content;
    	}
    
    endif;
    
    add_filter('the_content', 'mauer_append_post_author_name', 1, 5);

    It’s great to know you like the theme. I’d be really grateful if you could rate it on ThemeForest. This literally takes a moment and helps a lot.

    Kind regards,
    Paul

    #1644

    thepalmdiaries
    Participant

    Thanks Paul – I’ve left you a 5 star rating, great theme!

    #1654

    Paul
    Keymaster

    You’re very welcome, Tom!

    Thanks for having chosen Essentialist for your project.

    Best,
    Paul

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.