WordPress.org

Ready to get started?Download WordPress

Forums

Ryu
Google+ is using the wrong post image (4 posts)

  1. bru.scopelliti
    Member
    Posted 1 year ago #

    I found that when sharing a link on google+, the featured image displayed is wrong; in fact in this case it's showed the image used as main image of the theme.

    I solved this issue setting the following metatag:

    <?php if (has_post_thumbnail( $post->ID ) ): ?>
    <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
    <meta itemprop="image" content="<?php echo $image[0]; ?>">
    <?php endif; ?>

    Hope this could help someone.

  2. Lance Willett
    Themer
    Posted 1 year ago #

    Thanks Bru, for posting this.

  3. sterestherster
    Member
    Posted 3 months ago #

    Where do you paste this metatag?

  4. This forum is for Ryu-specific theme issues, and I see you've already posted in the Yoast SEO plugin forum:

    http://wordpress.org/support/topic/image-issue-with-google

    I'll leave this thread open in case the OP is around and can chime in about where he added this code.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags