Support » Fixing WordPress » How to set featured image for facebook like

  • Resolved Florence


    Hello! I was wondering if someone could help me with this. When I like a one of my blogposts, facebook grabs the wrong image and posts it on my wall.

    My theme uses featured images and I’d like it to pick that image instead. I’ve been trying to find solutions on the internet but it’s either beyond what I can comprehend (I’m not a very experienced coder) or it didn’t work.

    Don’t know if this is significant information but I’ll post it anyway. I have a plugin installed that overrides the featured image if I enter a featured video. The code for that goes like this:

    if(get_post_meta(get_the_ID(), "_related-video", true) != ''){
       // show the video embed code if there is one
        echo get_post_meta(get_the_ID(), "_related-video", true);
       if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())  ) {
        // show the image thumb if there is one, and the post does not have a video
        the_post_thumbnail('post-thumb', array('class' => 'post-thumb'));

    Thanks in advance!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to set featured image for facebook like’ is closed to new replies.