The meta-thumbnail displayed on Google mobile is displayed with an unintended image selected.
This is the home page meta thumbnail.
I wrote the code like this in the function php of the child theme to fix it, but I couldn’t fix it.
function add_meta_to_head() {
if ( is_home() || is_front_page() || is_page() ) {
echo ‘<meta name=”thumbnail” content=”any_image_url_here” />’;
}else{
echo ‘<meta name=”thumbnail” content=”‘ .wp_get_attachment_url( get_post_thumbnail_id() ). ‘” />’;
}
}
add_action( ‘wp_head’, ‘add_meta_to_head’ );
After writing this, I examined the page source and found that the header contained the code properly. However, it will not be reflected forever.
Where is the set image prioritized?
Is it possible to set the meta thumbnail of Google’s mobile display somewhere?
Anyway, please support me.
Attachments:
You must be
logged in to view attached files.