/    Sign up×
Community /Pin to ProfileBookmark

FB OenGraph image not displaying

Hi all.

I am working on some code to randomly select og meta from a list of choices to change the website preview when you share a post on Facebook, so far it’s going well, the title and description are working and are random, the issue is the images aren’t displaying.

Using FB debugging i can see it is calling the correct images and the links to the images work, they are just not displayed when the URL is posted to FB.

My code so far

[code=php]<?php
$titles = array(‘title1’, ‘title2’, ‘title3’);
$images = array(‘http://portfolio.innofydesign.com/ogimage/1.jpg’, ‘http://portfolio.innofydesign.com/ogimage/2.jpg’, ‘http://portfolio.innofydesign.com/ogimage/3.jpg’);
$descriptions = array(‘description1’, ‘description2’, ‘description3’);
?>[/code]

[CODE]<meta property=”og:title” content=”<?php echo $titles[array_rand($titles)]; ?>” />
<meta property=”og:title” content=”<?php echo $titles[array_rand($titles)]; ?>” />
<meta property=”og:image” content=”<?php echo $images[array_rand($images)]; ?>” />
<meta property=”og:description” content=”<?php echo $descriptions[array_rand($descriptions)]; ?>”/>
<meta property=”og:image:width” content=”200″ />
<meta property=”og:image:height” content=”200″ />
[/CODE]

Facebook debugger shows the preview as this (no errors)

[URL=”https://i.stack.imgur.com/CbkS8.png”]https://i.stack.imgur.com/CbkS8.png[/URL]

Open Graph debugger shows

[URL=”https://i.stack.imgur.com/wujSd.png”]https://i.stack.imgur.com/wujSd.png[/URL]

Sorry if i have missed anything, or i have this is the wrong place, getting this far on what i though was simple thing has been hard enough and any help will be greatly appreciated.

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @nickp spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...