mercredi 25 février 2015

Is there a filter to define the OG image on a given post?


I am looking for a filter to define what image on a post should be the facebook OG image. I am using the yoast seo plugin and by default it looks to put the OG meta on the featured image. In this case I am not attaching a featured image to the post but rather the image lives else where in the meta data. How can I tell it to use that image instead?


According to the yoast api docs there is a frontend filter for "wpseo_opengraph_image" and "wpseo_opengraph_image_size" but those are not executing on the frontend.



//never actually is triggered?
function new_og_image($img){
var_dump($value);
die('stop');
}
add_filter('wpseo_opengraph_image', 'new_og_image');


So is there another way I should be doing this?





Aucun commentaire:

Enregistrer un commentaire