Tagged: blog author
-
AuthorPosts
-
December 13, 2023 at 12:00 am #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,
MattDecember 13, 2023 at 3:32 am #1427941Hi 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,
NikkoDecember 13, 2023 at 6:50 am #1427951Thanks 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,
MattDecember 13, 2023 at 8:16 am #1427956Hi Matt,
Can you give us temporary admin access to it?
Just post the credentials in private content.Best regards,
NikkoDecember 13, 2023 at 8:29 am #1427957This reply has been marked as private.December 15, 2023 at 12:50 am #1428164Hi 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,
NikkoDecember 15, 2023 at 12:56 am #1428165Thanks Nikko, that’s perfect! You can close this ticket.
Cheers,
MattDecember 15, 2023 at 1:08 am #1428169Hi Matt,
I’m glad that we could help you :)
Thanks for using Enfold and have a great day!Best regards,
Nikko -
AuthorPosts
- The topic ‘Add author meta to top of blog’ is closed to new replies.