Tagged: schema.org
-
AuthorPosts
-
April 16, 2015 at 11:38 pm #429985
Hi guys!!!
Hope you are doing great. I have a quick question. How can I modify the schema.org mainContentOfPage property from Blog to Article on my child theme?
Check this out:
https://developers.google.com/structured-data/testing-tool/
If I test the page/home everything is good but when I test an article: http://hispanic-marketing.com/mini-cooper-ambient-guerilla-marketing-ads/
it gives me an error on “Blog is not a known valid target type for the mainContentOfPage property.”<main class=’content units av-content-small alpha av-blog-meta-comments-disabled av-blog-meta-html-info-disabled av-blog-meta-tag-disabled’ role=”main” itemprop=”mainContentOfPage” itemscope=”itemscope” itemtype=”https://schema.org/Blog” >
All your help is much appreciated!!! :)
Warmly,
Havi
April 18, 2015 at 7:42 pm #430744Hi havi!
please update to Enfold v3.1.3.
Let us know when the issue persists after you use the newest theme version.Best regards,
AndyApril 21, 2015 at 11:28 pm #432445Hi Andy!! :)
I updated and the issue persists… :(
Warmly,
Havi
April 22, 2015 at 1:08 pm #432733Hi!
Edit includes > helper-markup.php. Look for this code:
$attributes['itemprop'] = 'mainContentOfPage';
Replace it with:
if (is_singular('post')) { unset($attributes['itemprop']); } else { $attributes['itemprop'] = 'mainContentOfPage'; }
Regards,
IsmaelApril 26, 2015 at 9:25 pm #434920Hi Ismael!
I created an includes folder and added the helper-markup.php modified with the new code (replaced) to the child theme but now it gives me 3 errors… :(
Shouldn’t the attribute be “article”?
I modified it on a client’s site:
That secant now reads like this:
case ‘content’:
$attributes[‘role’] = ‘main’;
if (is_singular(‘post’))
{
unset($attributes[‘itemprop’]);
}
else
{
$attributes[‘itemprop’] = ‘mainContentOfPage’;
}and here’s a page (it’s easier on this one as it’s to multisite and already updated to the latest version of wordpress)
Here’s the page I tested:
http://bodasyweddings.com/25-imagenes-de-pasteles-de-boda-originales-e-irresistibles/I also updated all of the version on my site (not my client’s) and did not modify the child theme so you can see the difference and I have the same errors:
http://hispanic-marketing.com/17-pinterest-statistics-for-business-you-need-to-know/Quick question and just to make sure, I have to create the folder includes in the child theme, correct? (It is what I did on the bodasyweddings child theme)
Thank you so much for your help!!!
Warmly,
Havi
April 27, 2015 at 3:30 am #434967Hi!
The code above should unset or remove the itemprop=”mainContentOfPage” of the single post page but it’s not happening on your installation so I guess the modifications on the child theme is not working. Please try to change it directly in the parent theme files. I tested it on my installation and the testing tool validate the whole post structure.
Regards,
IsmaelMay 1, 2015 at 11:26 pm #438302Hi Ismael!
Sorry for the delay… I updated to the latest version of Enfold 3.1.5 and made the modifications you gave me (on the parent theme) and it worked like a charm for the Blog error! Now I have errors on the comments section:
“The property commentText is not recognized by Google for an object of type Blog.”
<div class=’comment_text entry-content-wrapper clearfix’ itemprop=”commentText” >
http://bodasyweddings.com/frases-de-amor-para-tus-invitaciones-de-boda/
https://developers.google.com/structured-data/testing-tool/
I made the modifications on the site that is not multisite to make it simpler.
Also, are you planning on adding these modifications to the next Enfold release? It would be great so I don’t have to keep on remembering to update this file on the parent theme. :)
Thank you so much!! Please let me know if there’s any info I can give you or help you with.
Warmly,
Havi
May 4, 2015 at 3:13 pm #438936Hey!
Please edit includes > loop-commments.php, look for this code around line 17:
<article>
Replace it with:
<article <?php avia_markup_helper(array('context' => 'comment','echo'=>true)); ?>>
There will be no error after that but there will be a warning for the commentTime structure. You can just ignore it for now.
Cheers!
IsmaelMay 22, 2017 at 8:18 am #797440I tried everything mentioned above and I’m still getting this from Google:
“Blog is not a known valid target type for the mainContentOfPage property.”
Any help would be greatly appreciated.
error: http://imgur.com/a/Lhy5X- This reply was modified 7 years, 7 months ago by FrequentC.
May 24, 2017 at 8:51 pm #799131Hi,
What is your URL, so we can check with schema validator?
Best regards,
Basilis -
AuthorPosts
- You must be logged in to reply to this topic.