Specify thumbnails

We’d like to have a thumbnail tags on website’s pages.
According to Google we have to add a thumbnail meta tag in HTML output.

To specify a thumbnail image for a page, you can add a thumbnail meta tag to the section of the page, like this:
<meta name="thumbnail" content="http://example/foo.jpg" />

How can we do it using a Pro theme?
Thanks.

Hello Olexandr,

Please install and activate the child theme and login through FTP then edit the functions.php then add this code:


add_action('wp_head', 'add_header_code');
function add_header_code(){
?>
    <meta name="thumbnail" content="<?php echo get_the_post_thumbnail_url(); ?>" />
<?php
};

Hope this helps.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.