Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1462976

    I have seen threads on how to do this but they are impossibly long and confusing. Could you please provide the instructions? Thank you!

    #1463030

    Hey williamslyd,

    Thank you for the inquiry.

    Please use the following filter in the functions.php file to append the author name to the grid items:

    function avf_post_slider_meta_content_mod($meta_content, $entry, $index, $atts, $meta_array) {
        $meta_author = '<div class="slide-meta-del">/</div>';
        $meta_author .= '<div class="slide-meta-author">';
        $meta_author .= __( 'Author:', 'avia_framework' ) . '<span> ' . get_the_author_meta('display_name', $entry->post_author) . '</span>';
        $meta_author .= '</div>';
    
        $meta_content .= $meta_author;
    
        return $meta_content;
    }
    
    add_filter('avf_post_slider_meta_content', 'avf_post_slider_meta_content_mod', 10, 5);

    Best regards,
    Ismael

    #1484350

    Hi there, I added this code but it didn’t work. I would like the post grid to display the author name exactly as it does on my blog post widget.

    #1484391

    Hi,
    When I test this snippet, it works for me on my site. Please ensure that you copied the code from the forum and not an email notification so the symbols are not converted.
    Then in the user profile make sure that the “Nickname” and the “Display name publicly as” is what you want to show:
    Screen Shot 2025 05 17 at 5.21.43 PM
    this is how it shows on my site
    Screen Shot 2025 05 17 at 5.23.06 PM
    I can not see your site as it requires a login.

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.