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

    (@jeherve)

    Jetpack Mechanic ??

    When you share a post on Facebook, or when Jetpack Publicize publishes a post to your Facebook page, Facebook crawls the page and looks for Open Graph meta tags in the head to build a complete post preview (with an image, title, description, …).

    1. On your home page, no image tag is added, so Facebook grabs a random image on the page. To solve this issue, you could add an image tag only on the home page, by adding the following code to your theme’s functions.php file:
      function fb_home_image() {
      	$fb_home_img = 'YOUR_IMAGE_URL';
      	$fb_home_img_output = sprintf( '<meta property="og:image" content="%s" />', esc_attr( $fb_home_img ) );
      	if ( is_home() )
      		echo $fb_home_img_output;
      }
      add_action( 'wp_head', 'fb_home_image' );
    2. On all your Posts and Pages, Jetpack grabs an image if you have inserted one in your post, and if that image is larger than 200 x 200px, as required by Facebook. However, if you do not insert any image into your post, no image tag is created, and Facebook will pick an image at random. To solve this issue, insert an image into your posts, or set a Featured Image for that post
    Thread Starter timesurfer2100

    (@timesurfer2100)

    Perfect help, thank you very much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Publicize Problem Facebook Image… yup, again!’ is closed to new replies.