Replace default og:image tag YOAST
I'm trying to replace the default image picked by yoast (featured image) with a custom with the relative og:image:width and og:image:height, but seems a mission impossible!
I tryed with this:
function my_own_og_function() {
$my_image_url = 'http://www.mywebsite.net/wp-content/uploads/TEST-A.jpg';
$GLOBALS['wpseo_og']-image( $my_image_url ); // This will echo out the og tag in line with other WPSEO og tags
}
add_action( 'wpseo_opengraph', 'my_own_og_function', 29 );
But yes, the image is replaced, only is without og:image:width and og:image:height
So i'm wondering, is there away to make it possible? Please, i need your help to make this, i have spent all the night trying to achive what i'm looking for... Thanks a lot! :)
Topic plugin-wp-seo-yoast php plugins Wordpress
Category Web