Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jan-Willem

    (@janwoostendorp)

    Hello,

    Yes it it possible. Do keep in mind that it will only appear when no featured image is set. And you probably will need to adjust the size.
    Also keep in mind avatars are usually square.

    
    function dfi_author_avatar($html, $post_id) {
    	// get the post
    	$post = get_post($post_id);
    	$size = 96;
    	return get_avatar( $post->post_author, $size );
    }
    add_filter( 'dfi_thumbnail_html', 'dfi_author_avatar', 10, 2 );

    Let me know.
    Jan-Willem

    Thread Starter blogogradjanin

    (@blogogradjanin)

    Thank you very much sir,
    I forgot to mention that my coding knowledge is very limited.
    Where to put the code you wrote.
    Thanks a lot again, and I’m sorry to bother you.
    Best regards.

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Hello,

    Either put it in the functions.php of a childtheme.

    Or create a file: wp-content/mu-plugins/dfi_author_avatar.php
    On the first line put ‘<?php’ and paste the code below that.

    Hope this helps
    Jan-Willem

    Thread Starter blogogradjanin

    (@blogogradjanin)

    Thanks a lot man!
    It works, but only if your plugin is on, I think.
    Not a problem, maybe in some future version of your plugin you can add this as an option.
    Thanks again, I wish you much success.

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Good to hear it worked.

    I doubt I’ll add it to a future version.
    More features means more maintenance.
    I prefer giving people a custom snippet for custom requests.

    Jan-Willem

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Avatar – Default featured image’ is closed to new replies.