We're merging with GenerateBlocks! Learn more here.

[Support request] Author avatar in single posts and archives

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Author avatar in single posts and archives

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #31949
    Roger
    Participant

    Hi,

    How to add the avatar of the author of the post in the archive page and also in the individual post?

    see this link: https://concertista.com.br/avatar/

    #31962
    elvin
    Moderator

    Hi Roger,

    For this we’ll have to filter the author meta’s output to add in their avatar.

    Check the PHP snippet provided here – https://wpshowposts.com/support/topic/change-author-link-to-a-plugin-new-created-profile/#post-24736

    #31974
    Roger
    Participant

    Thank you Elvin.

    Do I need to paste this code into function.php?

    #32004
    elvin
    Moderator

    Thank you Elvin.

    Do I need to paste this code into function.php?

    You can use Code Snippets plugin if you want. If you must use functions.php, make sure it’s a child theme. If you’re placing it on a parent theme’s functions.php, it can get wiped if you update the theme. 😀

    #32035
    Roger
    Participant

    Hi Elvin, I pasted the code into the Code Snippets plugin but it didn’t work.

    Do I need to do any additional configuration?

    Thanks.

    #32072
    elvin
    Moderator

    Can you explain a bit more on what avatar the authors uses? Is it the default avatar of WordPress? Perhaps is it coming from a plugin?

    Also, any chance you can link me to the page you’re working on to inspect if the HTML structure renders? Let us know. 😀

    #32074
    Roger
    Participant

    Hi Elvin,

    I’m using the Simple Local Avatars plugin.
    I also tested the code without the plugin and it didn’t work either.

    How can I send you login information for you to verify HTML?

    #32082
    elvin
    Moderator

    You can send the credentials through our contact us page – https://wpshowposts.com/contact/

    #32185
    elvin
    Moderator

    Hi Roger,

    I’m not exactly sure how that plugin fetches its image. Any chance you can contact its support about this?

    Once we know how to fetch the image value, we can filter it in on the same filter.

    Note: I did a bit of research but I’m not sure if this is updated – https://plugins.trac.wordpress.org/browser/simple-local-avatars/trunk/simple-local-avatars.php#L522

    You can try the get_simple_local_avatar function.

    #32227
    Roger
    Participant

    Hi Elvin,

    I will try to get information about the plugin.

    Thanks!

    #32250
    elvin
    Moderator

    Once you get the proper function for that plugin, you can modify this line on the PHP snippet – get_avatar( get_the_author_meta( 'ID' ) ) – with the function that shows the avatar taken from the plugin.

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