Tagged: author, post slider, post-excerpt
Hi guys,
is it possible to show the author avatar image on the post slider?
Regards,
Andy
Hey burdeMedia,
Yes, but there are some things you need to do first so it’s permanent.
First you’ll need to use a child theme: https://kriesi.at/documentation/enfold/child-theme/
Then do the instructions mentioned here: https://kriesi.at/documentation/enfold/intro-to-layout-builder/#add-elements-to-alb
Inside the child theme, create a folder and name it shortcodes
Copy (from the parent theme) postslider.php (located in enfold > config-templatebuilder > avia-shortcodes > postslider folder) and paste it in the shortcodes folder of the child theme.
Modify postslider.php (in the child theme) and find this code (line 634):
$output .= !empty($excerpt) ? "<div class='slide-entry-excerpt entry-content' $markup>".$excerpt."</div>" : "";
below it add this code:
$output .= "<img src=" . get_avatar_url(get_the_author_meta('user_email', $current_post['id'])) . " alt=\"author\" />";
Hope this helps.
Best regards,
Nikko
Hi Nikko,
that works! Thx!
Great support!
Hi burdeMedia,
We’re glad that we could help :)
Thanks for using Enfold and have a great day!
Best regards,
Nikko