I’ve been having trouble with the thumbnails on the Share previews of some of my articles: articles with assigned post thumbnails didn’t show a thumbnail in the Share preview, but articles that didn’t have a thumbnail assigned worked just fine.
After looking around in the plugin I noticed that for images that have an assigned post thumbnail, the
sfc-share.phpboth grab the image like this:
$att = wp_get_attachment_image_src($thumbid, 'full');
I’m thinking that this might be causing me problems because my full-sized images are huge and the Facebook code just decides to quit after a while. So I changed the line above to this in both files:
$att = wp_get_attachment_image_src($thumbid, 'thumbnail');
And now my thumbnails work fine! If you think
thumbnailis too extreme, I think
mediumwould work too.
Also, there’s another bug in the
sfc-like.phpcode that I wanted to point out… After grabbing the assigned post thumbnail, the code inserts it into the header like this:
<link rel="image_src" href="<?php echo $att; ?>" />
When I think you actually meant to do this:
<meta property="og:image" content="<?php echo $att; ?>" />
Why am I posting here if I already solved my problem? The truth is that I love this plugin and I’d like to see these fixes integrated so that I don’t have to keep hacking at it whenever there’s a plugin update.
- The topic ‘[Plugin: Simple Facebook Connect] Bug in the way Like and Share plugins handle images’ is closed to new replies.