Hello Team.,
Structured Data Testing Tool (Google Webmaster Tools) has detected some errors on “mainContentOfPage “. How can I fix it? Hope there is no need to change parent theme.
blog '>
<main class='content units av-content-full alpha av-blog-meta-author-disabled av-blog-meta-html-info-disabled' role="main" itemprop="mainContentOfPage" itemscope="itemscope" itemtype="https://schema.org/Blog" >
Thanks a lot,
Adelaide
Hey turistai!
Thank you for using Enfold.
Is this happening on single post? Please refer to this link for a possible fix: https://kriesi.at/support/topic/schema-org-modifications/
Best regards,
Ismael
Hello Ismael,
yes it is happening only to one post. Should I try the instruction you linked?
The error states that “Blog” is not a valid target for the property “mainContentOfPage”.
Thanks again.
Hi!
Yes, try this mod: https://kriesi.at/support/topic/schema-org-modifications/#post-432733
Best regards,
Ismael
Thanks Ismael. I will try it.
Hey!
Alright. Don’t forget to add the additional modification in order to fix the warnings. Let us know if it works.
Regards,
Ismael
Hey!
Actually, you can’t add the code in the child theme. You need to edit the helper-markup.php directly in the parent theme folder. Just look for the code:
$attributes['itemprop'] = 'mainContentOfPage';
Replace it with:
if (is_singular('post'))
{
unset($attributes['itemprop']);
}
else
{
$attributes['itemprop'] = 'mainContentOfPage';
}
If there’s an error after the modification, just override the file.
Regards,
Ismael
Hey!
glad Ismael could help you. Let us know when you need some more help with the theme. We are happy to assist you.
Cheers!
Andy