WordPress.org

Ready to get started?Download WordPress

Forums

FaceBook grabs incorrect thumbnail image! (12 posts)

  1. ernestg
    Member
    Posted 2 years ago #

    I am using the "Facebook Like Thumbnail" plugin and it works great, but once I activate "WP-PostRatings" it chooses the rating image before the attached post thumbnail. Please help!

  2. ernestg
    Member
    Posted 2 years ago #

    Fixed! Added this to my head in my header.php

    <meta property="og:image" content="<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
    <?php echo $image[0]; ?>" />
  3. Ashfame
    Member
    Posted 2 years ago #

    I know you have fixed it for your site but can you tell me if the WP-PostRatings plugin actually adds the ratings image above the post content because that could be the reason.

  4. ernestg
    Member
    Posted 2 years ago #

    I had my PostRatings come after my image and PostRatings was somehow being used as the default image. I have a custom theme though, with custom placed PostRatings plugin.

  5. Ashfame
    Member
    Posted 2 years ago #

    How about a link to your page where this problem was occuring?

  6. ernestg
    Member
    Posted 2 years ago #

    It was for a website that doesn't exist anymore. Why? Do you need help with something?

  7. Ashfame
    Member
    Posted 2 years ago #

    Never mind! Just wanted to look into the issue.

  8. ernestg
    Member
    Posted 2 years ago #

    Yeah, it was just grabbing the star.png before my actual attachment that's all.

  9. Lester Chan
    Member
    Posted 2 years ago #

    You need to implement OpenGraph properly (in your theme) for Facebook to grab the correct image when sharing your link in FB

    https://developers.facebook.com/docs/opengraph/

  10. ernestg
    Member
    Posted 2 years ago #

    That's what I thought the plugin was for.

  11. Ashfame
    Member
    Posted 2 years ago #

    It specifies only the meta og:image tag and not all of them, I let FB figure that out from the page itself.

  12. ernestg
    Member
    Posted 2 years ago #

    Yes, I understand, but without the plugin and just adding in:

    <meta property="og:image" content="<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
    <?php echo $image[0]; ?>" />

    Fixed everything

Topic Closed

This topic has been closed to new replies.

About this Topic