Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Sumo

    (@sumome)

    Hey Abner!

    Looks good to me: http://sumo.ly/pYJy

    If you run into that issue again in the future, try re-scraping your page with the Facebook debugger tool:

    https://developers.facebook.com/tools/debug/

    Thread Starter Abner Magahud

    (@abner123)

    Hi,

    Thanks for replying. I figured that out. I put meta tag in wp_head.

    
    function insert_meta_tag_in_head() {
     global $post;
    
      if(!has_post_thumbnail( $post‐>ID )) {
    
      $default_image='<img src="http://placehold.it/780x400?text=[img]';
        echo '<meta property="og:image" content="'.$default_image . '"/>';
      }
      else{
    
       $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post‐>ID ), 'small' );
       echo '<meta property="og:image" content="'.esc_attr( $thumbnail_src[0] ).'"/>';
      }
    }
    
    add_action('wp_head','insert_meta_tag_in_head');
    
    

    This is resolved already.

    Thanks,
    Abner

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Wrong Image using Facebook Share’ is closed to new replies.