-
AuthorPosts
-
August 18, 2016 at 7:29 pm #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?August 23, 2016 at 2:13 am #676109Hey 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,
IsmaelAugust 23, 2016 at 8:31 am #676245Hi 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.
August 26, 2016 at 5:54 am #677938August 26, 2016 at 11:25 am #678055Hi 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 8 years, 3 months ago by Dutchman.
August 31, 2016 at 5:40 am #679795Hi,
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,
IsmaelSeptember 4, 2016 at 2:37 pm #681797Hi Ismael! This is working! Thanks!! But can you explain a little what your code changes?
September 7, 2016 at 6:35 am #682983Hi,
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,
IsmaelSeptember 14, 2016 at 7:41 am #686180Hi Ismael, thank you very much!
September 15, 2016 at 7:17 am #686753 -
AuthorPosts
- The topic ‘The property blogpost is not recognised by Google for an object of type Blogpost’ is closed to new replies.