0

I'm trying to create a new og:image for author avatar when the users sharing their author profile page to Facebook, i used wpseo_opengraph_image filter, but when i share the link for the first time the image not showing and in the second time it comes up! when i look to the Inspector <head> i see <meta property="og:image" content="http://h"> !!, this is code i'm using

function custom_author_og_image() {
if ( is_author ( ) ) {
$author = get_queried_object();
    $image_attributes = get_avatar_url( $author->user_email, 200 );
    if ( $image_attributes !== false ) {
        return $image_attributes[0];
    }
}

} add_filter('wpseo_opengraph_image', 'custom_author_og_image', 10, 0);

Any help please? if i miss any details please tell me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.