Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #674325

    Hi
    According to Google structured data testing tool the website has problems with blogpost.

    This testing tool shows me following warning:
    The property blogpost is not recognised by Google for an object of type Blogposting.
    +
    Blog is not a known type for the property mainContentOfPage.

    The link is in the private section. I have more links with this issue.
    How can I solve this problem?

    #676109

    Hey Dutchman,

    I’m very sorry for the late response. Please add this in the functions.php file:

    add_filter('avf_markup_helper_attributes', 'avf_markup_helper_attributes_modified', 10, 2);
    function avf_markup_helper_attributes_modified($attributes, $args) {
    	if($args['context'] == 'entry') {
    		//* If main query,
    		if ( is_main_query() ) $attributes['itemprop']  = '';
    	}
    
    	return $attributes;
    }
    

    Best regards,
    Ismael

    #676245

    Hi Ismael,

    It doesn’t make any difference. I get the same amount and types of errors. I’ve added the code at the bottom of functions.php and tried different browsers.

    #677938

    Hi,

    My bad. The code is incomplete. Please try it again.

    Best regards,
    Ismael

    #678055

    Hi Ismael, thanks! I used an outdated version of postslider.php and with the latest version the errors are gone, just 1 error left:
    “Blog is not a known type for the property mainContentOfPage.
    <main class='content av-content-full alpha units' role="main" itemprop="mainContentOfPage" itemscope="itemscope" itemtype="https://schema.org/Blog" >
    The link is in the private section.

    • This reply was modified 7 years, 11 months ago by Dutchman.
    #679795

    Hi,

    Please replace the code with the following:

    add_filter('avf_markup_helper_attributes', 'avf_markup_helper_attributes_modified', 10, 2);
    function avf_markup_helper_attributes_modified($attributes, $args) {
    	if($args['context'] == 'entry') 
            {
    		//* If main query,
    		if ( is_main_query() ) unset($attributes['itemprop']);
    	}
    
            if($args['context'] == 'content') 
            {
                    if (is_singular('post') || is_archive() || is_home())
                    {
                        $attributes['itemprop'] = 'mainEntity';
                    }
    	}
    
    	return $attributes;
    }

    Best regards,
    Ismael

    #681797

    Hi Ismael! This is working! Thanks!! But can you explain a little what your code changes?

    #682983

    Hi,

    It unsets the itemprop attribute if the itemtype is set to BlogPosting. And replace the value of the itemprop attribute from “mainContentOfPage” to “mainEntity”.

    Best regards,
    Ismael

    #686180

    Hi Ismael, thank you very much!

    #686753

    Hi,

    Glad we could help :-)

    Please open a new thread if you should have any further questions or problems.

    Regards,
    Rikard

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘The property blogpost is not recognised by Google for an object of type Blogpost’ is closed to new replies.