Tagged: 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1427919

    Hi,

    I would really like the blog post author name to appear at the top of the blog, under the post title, rather than at the end of the post. How can I achieve this please?

    Cheers,
    Matt

    #1427941

    Hi Matt,

    You would need to use a child theme to achieve it.
    If you aren’t using a child theme yet, you can get it here: https://kriesi.at/documentation/enfold/child-theme/

    Once you have installed the child theme, create includes folder inside it, then copy loop-index.php from Enfold (parent theme) and paste it inside includes.
    Open loop-index.php and find this code (line 488-509):

    /**
     * Allow to change theme options setting for certain posts
     *
     * @since 4.8.8
     * @param boolean $show_author_meta
     * @param string $context
     * @return boolean
     */
    if( true === apply_filters( 'avf_show_author_meta', 'blog-meta-author' == avia_get_option( 'blog-meta-author' ), 'loop-index' ) )
    {
        $meta_author  = '<span class="blog-author minor-meta">' . __( 'by', 'avia_framework' ) . ' ';
        $meta_author .=		'<span class="entry-author-link" ' . avia_markup_helper( array( 'context' => 'author_name', 'echo' => false ) ) . '>';
        $meta_author .=			'<span class="author">';
        $meta_author .=				'<span class="fn">';
        $meta_author .=					get_the_author_posts_link();
        $meta_author .=				'</span>';
        $meta_author .=			'</span>';
        $meta_author .=		'</span>';
        $meta_author .= '</span>';
    
        $meta_info['author'] = $meta_author;
    }

    Cut the code and paste it on line 378 (put the code below this code):

    $close_header = '';

    Hope it helps.

    Best regards,
    Nikko

    #1427951

    Thanks Nikko. I am already using a child theme, so added the includes folder, copied the loop-index,php file, cut the code and pasted it on line 378 and cleared all caches.

    Author name no longer showing up at bottom of blog posts, but not showing at top either! Any ideas why?

    Thanks,
    Matt

    #1427956

    Hi Matt,

    Can you give us temporary admin access to it?
    Just post the credentials in private content.

    Best regards,
    Nikko

    #1427957
    This reply has been marked as private.
    #1428164

    Hi Matt,

    Thanks for providing the admin access.
    I made a mistake on the code I gave, this part:

    $meta_info['author'] = $meta_author;

    should be:

    echo $meta_author;

    I have made the changes on your site.
    Please review your site.

    Best regards,
    Nikko

    #1428165

    Thanks Nikko, that’s perfect! You can close this ticket.

    Cheers,
    Matt

    #1428169

    Hi Matt,

    I’m glad that we could help you :)
    Thanks for using Enfold and have a great day!

    Best regards,
    Nikko

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Add author meta to top of blog’ is closed to new replies.