Hi,
I have been using this code for a while now.
function add_hatom_data($content)
{
$t = get_the_modified_time('F jS, Y');
$author = get_the_author();
$title = get_the_title();
$posttype = get_post_type( get_the_ID() );
if ( $posttype = "portfolio" ) {
$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_hatom_data');
However, I see some missing structured data informations:
No author or published date are included in the tag archive page
https://search.google.com/structured-data/testing-tool/u/0/?url=https://kinesante.ca/mot-cle/oedeme/#url=https%3A%2F%2Fkinesante.ca%2Fmot-cle%2Foedeme%2F
And here, why the author is a ”thing?”
https://search.google.com/structured-data/testing-tool/u/0/?hl=fr#url=kinesante.ca%2Farticles
In an blog post, is there a way to include the url of the organisation for the theme?
https://search.google.com/structured-data/testing-tool/u/0/?hl=fr#url=https%3A%2F%2Fkinesante.ca%2Fosteopathie%2Fhernie-discale-traitement-osteopathie%2F
I thought the code woudn’t be necessary with the last theme update, but it seems that I still need it, am I right? Is it the responsability of the theme to include thoses informations, or I should seek a plugin or a custom code, they are quite critical for seo.