Articles linked on Facebook don't display thumbnails images
-
Hi,
I need help with the following:
Problem: Articles linked on Facebook don’t display thumbnails images. Facebook like/share doesn’t represent my posts properly. It chooses the first picture which happens to be my post title.
2. I’m using two plugins:
a. Tweet, Like, Share and Google +1 Option Page
b. Simple Social – Sharing Widgets & IconsHow should I modify the facebook plugin so it will show my second image all of the time (my first is the title)when someone press like/share button?
At ‘Tweet, Like, Share and Google +1’ plugin code, there are two attributes which define the og:image:
<meta property="og:image" content="<?php echo $thumb; ?>" /> <meta property="og:image" content="<?php echo $default_img; ?>" />
function s4_get_first_image() { global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); $first_img = $matches[1][0]; return $first_img; }
From the code, the point where I need to define the picture number is:
$matches[1][0]
Should I change it to $matches[2][0]?
Thanks and regards,
Kfir Silis
- The topic ‘Articles linked on Facebook don't display thumbnails images’ is closed to new replies.