• Resolved rishavgupta

    (@rishavgupta)


    Hi Veda,

    Is there a way to put small picture of author after blog/post title?

    I wanted to put author picture, name and date of creation/modification after the title on home page e.g. https://backlinko.com/improve-your-seo.
    Also any work-around to push title and author name below cover/featured image in the blog page?

    Regards,

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter rishavgupta

    (@rishavgupta)

    .

    • This reply was modified 5 years, 3 months ago by rishavgupta.
    Theme Author Veda

    (@vedathemes)

    Will reply by today

    Theme Author Veda

    (@vedathemes)

    Copy and paste following code at the end of your child theme’s functions.php file (If you do not use child theme, please use Code Snippet plugin).

    Side note: You can also directly paste the code at the end of main theme’s functions.php, however all changes will be lost on theme update.

    /**
     * New Entry meta function to include author avatar image.
     */
    function bayleaf_custom_entry_meta() {
    	global $post;
    	?>
    	<span<?php bayleaf_attr( 'meta-author-avatar' ); ?>>
    		<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID', $post->post_author ) ) ); ?>"<?php bayleaf_attr( 'url' ); ?>><span<?php bayleaf_attr( 'name', false ); ?>> <?php echo get_avatar( get_the_author_meta( 'user_email', $post->post_author ), 36 ); ?></span></a>
    	</span><!-- .meta-author -->
    	<?php
    	bayleaf_entry_meta();
    }
    
    /**
     * Modify entry meta callback function,
     */
    function bayleaf_custom_modify_entry_meta() {
    	return [ 'bayleaf_custom_entry_meta' ];
    }
    add_filter( 'bayleaf_markup_entry_meta', 'bayleaf_custom_modify_entry_meta' );

    This will add author picture before author name. Use .meta-author-avatar and .meta-author-avatar img class to add custom styling.

    Always backup your site before making changes in PHP.

    Theme Author Veda

    (@vedathemes)

    Use following code to move entry-meta below post title,

    function bayleaf_custom_page_entry_header_items() {
    	return [
    		[ 'bayleaf_get_template_partial', 'template-parts/post', 'entry-title' ],
    		'bayleaf_entry_meta_wrapper',
    	];
    }
    add_filter( 'bayleaf_markup_page_entry_header_items', 'bayleaf_custom_page_entry_header_items' );
    Thread Starter rishavgupta

    (@rishavgupta)

    Thanks Veda, Author name corrected however, image is not showing up.
    But let me try again

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Author Name with picture below title’ is closed to new replies.