Fixing hentry – missing updated in google search console

Posted in: Newspaper
Post count: 49

Is it safe to add the following code in the function.php file of the theme to get rid of search console errors

function add_atom_data($content) {
$t = get_the_modified_time(‘F jS, Y’);
$author = get_the_author();
$title = get_the_title();
if (is_home() || is_singular() || is_archive() ) {
$content .= ‘<div class=”hatom-extra” style=”display:none;visibility:hidden;”><span class=”entry-title”>’.$title.'</span> was last modified: <span class=”updated”> ‘.$t.'</span> by <span class=”author vcard”><span class=”fn”>’.$author.'</span></span></div>’;
}
return $content;
}
add_filter(‘the_content’, ‘add_atom_data’);

Kindly confirm.

Thanks

Post count: 49

Can any staff confirm the above?

Post count: 22421
Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.