-
AuthorPosts
-
January 8, 2018 at 7:37 pm #894871
Hi,
On a post slider, i have the title and after the category.
I’d like to replace the category by the author. How can i do this in my child theme ?
Thanks for your helpJanuary 9, 2018 at 12:30 am #895013Hey smiollis,
So instead of the category you want to see the the author displayed instead?
Best regards,
Jordan ShannonJanuary 9, 2018 at 1:05 pm #895214Yes Jordan
But i’d like to modify my child theme : don’t want to loose this “hack” when i update enfold ;)
Thanks- This reply was modified 6 years, 10 months ago by smiollis.
January 10, 2018 at 11:35 pm #895868Hi,
You can check here
https://kriesi.at/support/topic/loading-shortcode-templates-from-child-theme/on how to load the shrotcode form the child theme. When you do that, you can replace then on the element the_author() from get_the_category()
Best regards,
BasilisJanuary 16, 2018 at 9:45 pm #898169Hi,
Thanks for your response but it didn’t work at this time :I Modified the functions.php file of my child theme to add :
add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths) { $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
created the directory shortcode and copy postlider.php in it
but i can’t find the “get_the_category”
please notice that i’m in modern business blog layout- This reply was modified 6 years, 10 months ago by smiollis.
January 20, 2018 at 3:07 pm #900093Hi,
Please look for the following code around line 548.
$meta_out .= $cats;
Best regards,
IsmaelJanuary 21, 2018 at 9:33 pm #900465Hi Ismael,
Thanks for your response ! But i’m still stuck :/
I’ve foud this btwn 540-550 :
if(!empty($cats))
{
$meta_out .= ‘<span class=”blog-categories minor-meta”>’;
$meta_out .= $cats;
$meta_out .= ‘</span>’;
}`
Tried to replace $cats by $author but it’s look not that simple :/
Thanks again for your help !
Seb- This reply was modified 6 years, 10 months ago by smiollis.
January 22, 2018 at 4:26 am #900548Hi,
$meta_out .= $cats;
Replace the line with the following code.
$meta_out .= get_the_author_meta( 'display_name' );
Best regards,
IsmaelJanuary 30, 2018 at 4:52 pm #904990Perfect ;)
Thanks a lot !January 30, 2018 at 5:11 pm #905004Hi,
I’m glad you were able to find a solution. If you need additional help. Please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Post slider customization’ is closed to new replies.