Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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 help

    #895013

    Hey smiollis,

    So instead of the category you want to see the the author displayed instead?

    Best regards,
    Jordan Shannon

    #895214

    Yes 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.
    #895868

    Hi,

    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,
    Basilis

    #898169

    Hi,
    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.
    #900093

    Hi,

    Please look for the following code around line 548.

    $meta_out .= $cats;
    

    Best regards,
    Ismael

    #900465

    Hi 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.
    #900548

    Hi,

    $meta_out .= $cats;

    Replace the line with the following code.

    $meta_out .= get_the_author_meta( 'display_name' );
    

    Best regards,
    Ismael

    #904990

    Perfect ;)
    Thanks a lot !

    #905004

    Hi,

    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

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Post slider customization’ is closed to new replies.