Hello, we’re trying to register the user avatar as the default featured image for a post. Here’s our code:

in our functions.php

function avatar_or_featured_image($html, $post_id){
    return $html;
  } else {
    return get_wp_user_avatar(get_the_author_meta('ID'), 96);
add_filter('post_thumbnail_html', 'avatar_or_featured_image', 10, 2);

The image is showing in our featured image column in the Posts List in admin panel, but the featured image doesn’t seem to be registering on the actual Post Edit page .

We’re using the theme.co X theme.

Please login or Register to Submit Answer