-
AuthorPosts
-
July 1, 2014 at 10:24 am #285624
Hi guys,
On my homepage I’m displaying blog posts in the grid format.
Now standard there is no blog author displaying which I’d like to.I’ve tried several things such as ‘get_user_meta’, ‘get_the_author’ and nothing worked for me.
How can I display the blog author per blog post on my homepage?
Thanks in advance.
Jerry
July 2, 2014 at 2:00 am #285977Hi Jerry,
Can you post the link to the website please?
Regards,
JosueJuly 2, 2014 at 9:49 am #286100This reply has been marked as private.July 2, 2014 at 10:37 pm #286422Hi Jerry,
Open /config-templatebuilder/avia-shortcodes/postslider.php and look for line 386:
$output .= "<time class='slide-meta-time updated' $markup>" .get_the_time(get_option('date_format'), $the_id)."</time>";
Replace it by this:
$output .= "<time class='slide-meta-time updated' $markup>" .get_the_time(get_option('date_format'), $the_id)."</time> / by ".get_the_author();
Regards,
JosueJuly 3, 2014 at 8:58 am #286537Hi Josue,
Thanks for your reply.
Unfortunately this did not completely worked. It’s showing names with the blog posts however it’s the same name for every post while the actual author is different.
So: the author on the archive is different then the actual blog author (which is also showing on the innerpage).I’ve attached two screenshots:
1. Archive – I’ve marked the same author in yellow below every post and the name of 1 post particular in orange
2. Innerpage – I’ve marked the author in yellow (you can see it’s different then the archive and the name of the post (to show it’s the same) in orange again.Thanks,
Jerry
July 3, 2014 at 12:04 pm #286592Hi!
Please go again to /config-templatebuilder/avia-shortcodes/postslider.php and look for line 386:
and replace this line with the following 2 lines:
$author = get_the_author_meta( 'user_nicename', $entry->post_author ); $output .= "<time class='slide-meta-time updated' $markup>" .get_the_time(get_option('date_format'), $the_id)."</time> / by ".$author;
If user_nicename is not what you want, you can also use:
$author = get_the_author_meta( 'first_name', $entry->post_author ).' '.get_the_author_meta( 'last_name', $entry->post_author );
Regards,
Günter- This reply was modified 10 years, 5 months ago by Günter.
July 3, 2014 at 12:11 pm #286599Hi Günter,
Thanks a lot!
This is working just fine.Thanks for the support guys.
Thanks,
JerryJuly 3, 2014 at 12:50 pm #286621 -
AuthorPosts
- The topic ‘Show blog author on blog grid’ is closed to new replies.