[resolved] How to set featured image for facebook like (2 posts)

  1. Florence
    Posted 3 years ago #

    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!

  2. Florence
    Posted 3 years ago #

    Found this plugin and it seems to working!

Topic Closed

This topic has been closed to new replies.

About this Topic