Home WordPress Facebook non carica le thumb

Facebook non carica le thumb

31
0

Dopo giorni di prove e ricerche su internet in tutte le lingue che conosco ho finalmente risolto il problema con la semplice aggiunta del seguente codice all’interno della pagina header.php prima di “wp_head”, che si trova su wp-content\themes\”vostro tema”


<?php if(is_single()) { global $wp_query; $post_id = $wp_query->post->ID;
 
$arrImages =& get_children('post_type=attachment&post_mime_type=image&post_parent=' . $wp_query->post->ID );
if($arrImages) {
    $arrKeys = array_keys($arrImages);
    $iNum = $arrKeys[0];
    $sThumbUrl = wp_get_attachment_thumb_url($iNum);
    echo '<link rel="image_src" type="image/jpeg" href="'. $sThumbUrl .'" />';
} else {
    echo '<link rel="image_src" type="image/jpeg" href="Thumbdibase" />';
}
 
}?>

Fatto questo rigenerate le Thumbnails

LEAVE A REPLY

Please enter your comment!
Please enter your name here