• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Fix WordPress mainContentOfPage Schema Error (Genesis)

By Abhishek Ghosh April 6, 2015 7:22 pm Updated on July 1, 2016

Fix WordPress mainContentOfPage Schema Error (Genesis)

Advertisement

The New Google Structured Data Testing Tool Gives Error Against Genesis HTML5 Child Themes. Commenting Out Three Lines Will Fix This Issue. According to IBM , Microdata is a simple way to add structured data on the web page. It defines several attributes, such as item type and itemprop, can be placed in the HTML tag to indicate what the page is about. Microdata was introduced in 2009 by Ian Hickson, the editor of the HTML5 specification. However, the origin of this idea before long. In this guide we will fix WordPress mainContentOfPage Schema error for Genesis child themes.

 

Why mainContentOfPage Schema Gives Error in Genesis Child Themes?

 

The practical answers are two – first is Google.

From their logic :

Advertisement

---

As we are using mainContentOfPage, you probably want to have a WebPage item. But this property can not have Blog as value, it needs to be a WebPageElement. So, removing itemprop="mainContentOfPage" is the right approach. You need not to become an expert of WordPress template hierarchy. You only need to do SSH and edit a file or edit from SFTP.

Secondly, the people who are involved in the development of the paid themes, rarely has a Masters degree on science related subject – you can forget about a degree on software engineering. All together, somehow running.

 

Fix WordPress mainContentOfPage Schema Error (Genesis)

 

If you add filter on Genesis child theme’s functions.php file, it will actually increase at least two query. One is from core of Genesis – which will direct to inject the snippet, another you added – on Genesis child theme’s functions.php file. If you comment out the function from the core of Genesis, you are decreasing one query. Only problem is that, you have to remember to do it every-time you update Genesis, till they fix it somehow. We are using Nginx on deb Linux, so our this file :

Vim
1
./wp-content/themes/genesis/lib/functions/markup.php

will be at :

Vim
1
/usr/share/nginx/html/wp-content/themes/genesis/lib/functions

… directory.

Genesis core files will bear “do not edit”, because it is pseudo Free Software. This is not Linux Kernel file, it is just a basic PHP file. You will not die by editing it. So we did an SSH to server, changed role as root user and changed directory to :

Vim
1
cd usr/share/nginx/html/wp-content/themes/genesis/lib/functions && ls

Run this command there :

Vim
1
cat markup.php | grep Blog

You will get these :

Vim
1
2
3
//* Blog microdata
//* Blog posts microdata
$attributes['itemtype']  = 'http://schema.org/Blog';

Open the file in nano :

Vim
1
nano markup.php

Find the phrase Blog with search ( ^ + W) function of Nano. You will find :

Vim
1
2
3
4
5
        //* Blog microdata
if ( is_singular( 'post' ) || is_archive() || is_home() || is_page_temp$
           $attributes['itemscope'] = 'itemscope';
           $attributes['item type']  = 'http://schema.org/Blog';
      }

Comment it out :

Vim
1
2
3
4
5
6
7
8
9
10
function genesis_attributes_content( $attributes ) {
 
        $attributes['role']     = 'main';
        $attributes['itemprop'] = 'mainContentOfPage';
 
        //* Blog microdata
//      if ( is_singular( 'post' ) || is_archive() || is_home() || is_page_temp$
//              $attributes['itemscope'] = 'itemscope';
//              $attributes['item type']  = 'http://schema.org/Blog';
//      }

Fix WordPress mainContentOfPage Schema Error (Genesis)

Write out with ^ + O and exit nano with ^ + O. Clear W3 Total Cache’s all Cache. Test it with the new Google Structured data testing tool. You will not get any error. If you have Genesis Simple Hooks plugin installed, you can go to the filed named genesis_before_entry Hook (under Entry Hooks) and add :

Vim
1
2
<span itemprop="genre" content="Technology">
<span itemprop "additionalType" content="Article">

You should add the values Technology and Article if it matches your niche. Else check the schema.org documentation. Again flush the cache and test. Right now, we have some errors related to JSON-LD plus our markup things are very complicated. Do not test ours, you might get confused.

Genesis like themes are not real Free Softwares, we can not see the diff for the next upgrade. So you have to manually do the works again.

 

Update for Genesis 2.2.6

 

All is same, except, search for the word CreativeWorks and change it to Article. They have not understood the stuff yet.

 

Update for Genesis 2.3

 

All is same, except —

– they kept the classification as CreativeWorks, hence you may and change it to Article. They have not understood the stuff and avoided complication. Just bad cheat.

– mainContentOfPage has been vanished.

Tagged With https://thecustomizewindows com/2015/04/fix-wordpress-maincontentofpage-schema-error-genesis/ , word press where to change itemprop=mainContentOfPage

This Article Has Been Shared 668 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Fix WordPress mainContentOfPage Schema Error (Genesis)

  • Fixing WordPress After Update : Fix For White Page

    Fixing WordPress After Update Video Guide practically shows you all the possible ways to fix your WordPress website in case you are facing the White Page issue.

  • WordPress Command Line Tool : Install and Run Commands

    WordPress Command Line Tool can be installed on any UNIX or UNIX Like OS. The usage ranges from installing a plugin, Publishing Post to anything you want.

  • YouTube Tips : Embed Playlist, YouTube’s audio, YouTube HTML5 Player

    Here are YouTube Tips to Embed YouTube Playlist, YouTube’s audio, YouTube HTML5 Player in any webpage or WordPress page or posts. Let us see how we can do them.

  • AdSense Asynchronous Ads with Responsive Design

    AdSense Asynchronous Ads with Responsive design is a quite difficult to manage or implement. Here are some ideas which might help you for HTML5 website.

  • Google Scholar Metadata : Guide For WordPress

    Here is a Full Guide to Rightly Debug Google Scholar Metadata for WordPress Including Debugging JSON-LD, Dublin Core and Conflicting Meta Tags.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Cyberpunk Aesthetics: What’s in it Special January 27, 2023
  • How to Do Electrical Layout Plan for Adding Smart Switches January 26, 2023
  • What is a Data Mesh? January 25, 2023
  • What is Vehicular Ad-Hoc Network? January 24, 2023
  • Difference Between Panel Light, COB Light, Track Light January 21, 2023

About This Article

Cite this article as: Abhishek Ghosh, "Fix WordPress mainContentOfPage Schema Error (Genesis)," in The Customize Windows, April 6, 2015, January 29, 2023, https://thecustomizewindows.com/2015/04/fix-wordpress-maincontentofpage-schema-error-genesis/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT