Tagged: 

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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&#8221; >

    http://schema.org/Article

    All your help is much appreciated!!! :)

    Warmly,

    Havi

    #430744

    Hi havi!

    please update to Enfold v3.1.3.
    Let us know when the issue persists after you use the newest theme version.

    Best regards,
    Andy

    #432445

    Hi Andy!! :)

    I updated and the issue persists… :(

    Warmly,

    Havi

    #432733

    Hi!

    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,
    Ismael

    #434920

    Hi 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

    #434967

    Hi!

    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,
    Ismael

    #438302

    Hi 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

    #438936

    Hey!

    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!
    Ismael

    #797440

    I 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 6 years, 11 months ago by FrequentC.
    #799131

    Hi,

    What is your URL, so we can check with schema validator?

    Best regards,
    Basilis

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.