How to replace the existing metatag using the backend to insure a thumbnail image gets fetched when we share on social media?
How to replace the existing metatag using the backend to insure a thumbnail image gets fetched when we share on social media?
function theme_a_header_metadata() {
global $post;
$image = \wpplugin\blogwidget\getBlogImage($post);
?
meta property=og:image content=?= getLocalImage($image, '1344x') ? /
?php
}
add_action( 'wp_head', 'theme_a_header_metadata' );
So I have this function, but the issue is that there's already a meta property with the property value of og:image, so how do I replace the meta tag? I need to use the backend, and I don't want to install any plugin.
Topic wp-head plugin-development Wordpress
Category Web