How to share a wordpress post having an animated gif as thumbnail image on facebook and, the new post on facebook, having a link back to the site (not the image)?
Wordpress uses "Yoast Wordpress SEO" plugin.
How to share a wordpress post having an animated gif as thumbnail image on facebook and, the new post on facebook, having a link back to the site (not the image)?
Wordpress uses "Yoast Wordpress SEO" plugin.
Simply set the canonincal url of the post to the image.
function custom_canonical($original=null){
global $post;
$size = 'downsized-large'; // your preferred size
if (has_post_thumbnail() == false) {
return $original;
}
$url = get_the_post_thumbnail_url($post, $size);
if (preg_match('/.gif$/i', $url)==false) {
return $original;
}
return $url;
}
add_filter('wpseo_canonical', 'custom_canonical',1);
Add at the end of "functions.php" under the theme dir.