• Resolved ninopro

    (@ninopro)


    I use Nelio External Featured Image on my WordPress website, i host my images on Imgur or Tinypic, when i share any post on facebook, facebook doesn’t share the featured image, it shares the related content images or the widget images.
    I added facebook meta tags but still doesn’t work.
    I tried to add the featured image from media library and it worked.
    So, i think facebook doesn’t recognize the featured image from url.
    Any solution for that ?
    Thanks.

    https://wordpress.org/plugins/external-featured-image/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author David Aguilera

    (@davilera)

    Hi!

    If you want the featured image to be displayed in Facebook, you need to add a meta tag in your site:

    <meta property="og:image"
       content="http://example.com/external-feat-image.jpg" />

    If the featured image is uploaded to the media library, this meta tag is added automatically. On the other hand, if the featured image is external, it looks like it isn’t. Try the following code and see if it works:

    add_action( 'wp_head', 'nelioefi_add_fb_meta', 99 );
    function nelioefi_add_fb_meta() {
      if ( is_single() ) {
        $post_id = get_the_ID();
        if ( function_exists( 'uses_nelioefi' ) && uses_nelioefi( $post_id ) ) {
          $src = esc_attr( nelioefi_get_thumbnail_src( $post_id ) );
          echo '<meta property="og:image" content="' . $src . '" />';
        }
      }
    }

    Please let me know if it helped!

    Thread Starter ninopro

    (@ninopro)

    Worked like a charm.
    Thank you so much.
    You’re great.

    This worked when I went to share the image (after the second try with each item – hmm), but when I went to look at it on Facebook, the image wasn’t there.

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

The topic ‘Facebook doesn't share the featured image’ is closed to new replies.