On my website when I click the Facebook button for share a post, I get a preview with a correct image but once I publish the same picture is not showing inside Facebook.
So I tried to fetch new scrape from the debugger, I don't have any issue related, also below the "When shared, this is what will be included" it shows me the correct image.
EDIT
I don't have a meta tag og:image in the head, because my page has different items, each one with a facebook button.
I'm using the TimThumb (ver. 2.8.14) script for the scope.
<div class="song-art"><a href="'.$this->url.'/index.php?a=track&id='.$row['id'].'" property="og:image" rel="loadpage"><img style="width: 112px;" src="'.$this->url.'/thumb.php?src='.$row['art'].'&t=m&w=200&h=200" id="song-art'.$row['id'].'" /></a></div>
This is how it looks the customized part of TimThumb script:
require_once('./includes/config.php');
if(!empty($_GET['t'])) {
if($_GET['t'] == 'a') {
$type = 'uploads/avatars';
$width_list = array(25, 50, 100, 112, 150, 200);
$height_list = array(25, 50, 100, 112, 150, 200);
$quality_list = array(50, 75, 100);
} elseif($_GET['t'] == 'm') {
$type = 'uploads/media';
$width_list = array(25, 50, 75, 100, 112, 200, 204, 300, 435, 500, 650, 700, 800, 900, 1000);
$height_list = array(25, 50, 75, 100, 112, 200, 204, 300, 435, 500, 650, 700, 800, 900, 1000);
$quality_list = array(50, 75, 100);
} elseif($_GET['t'] == 'c') {
$type = 'uploads/covers';
$width_list = array(300, 800, 900, 1000, 1100, 1200);
$height_list = array(100, 200, 300);
$quality_list = array(50, 75, 100);
} else {
exit('Invalid parameter value');
}
} else {
exit('The \'t\' parameter is not set.');
}
// Build up the src query
$_GET['src'] = $CONF['url'].'/'.$type.'/'.$_GET['src'];
if(!empty($_GET['w'])) {
if(!in_array($_GET['w'], $width_list)) {
exit('Invalid width value.');
}
}
if(!empty($_GET['h'])) {
if(!in_array($_GET['h'], $height_list)) {
exit('Invalid height value.');
}
}
if(!empty($_GET['q'])) {
if(!in_array($_GET['q'], $quality_list)) {
exit('Invalid quality value.');
}
}
Is there anything wrong with my code?