Facebook image selection for links

Started by Jade Elizabeth, August 21, 2014, 01:47:14 AM

Previous topic - Next topic

Jade Elizabeth

When I link to my site it shows me one picture I can link up as the picture for the link, and that picture is always in the footer.

Is there a way I can get FB to recognize avatars and pictures inside the post?
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.


Jade Elizabeth

You're having the same issues as me? I've been saving the picture and using the "upload picture" option but it's a pain in the butt!
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Biology Forums

Yea, of course, or it finds 4 random images on that page and it's hit-or-miss if one of them is the one I'm interested in.

There has to be some sort of marking on the <img that FB looks for.

Suki

There is if you use facebook "Open Graph" https://developers.facebook.com/docs/web/share

You need to add lots of stuff to your pages: https://developers.facebook.com/docs/web/webmasters

and its really difficult to get it done right for forum topics.

I remember there was a mod here that implemented the open graph stuff, it probably don't work properly by now but you can use it as reference to know just how many changes are needed to make it work on a forum's topic.

Additionally, if you follow all their suggtestions, theres still the chance it won't work properly anyway,  due to how facebook crwals your site using their own bots, it spossible that facebook will mark all your topics as one single unique page and thus it will use the very first image that was crawled from your site.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.


Jade Elizabeth

Is there a way to make it use the site logo or something then? That would be better. maybe we can make it a hidden value or something. It seems like a lot of bull crap for us to go through to make our sites work with theirs - they should be doing that not us!!
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Biology Forums

Here's what I've done. Pretty much it rotates randomly between three images of my choosing. I put this in the header section inside index.template.php.


// Set meta tags...

$bio_icon = '<meta property="og:image" content="'.$settings['default_theme_url'].'/images/biology.png" />';
$bchem_icon = '<meta property="og:image" content="'.$settings['default_theme_url'].'/images/biochemistry.png" />';
$other_icon = '<meta property="og:image" content="'.$settings['default_theme_url'].'/images/others.png" />';

// Put into an array...

$values = array($bio_icon, $bchem_icon, $other_icon);

// Randomize

$FB_image_tag = $values[array_rand($values)];

// Publish

echo'<!--Facebook-related tags-->',$FB_image_tag,'';


Let me know if you need help incorporating that.

Jade Elizabeth

Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.


Advertisement: