• 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
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)

  • Schema.org : Schemas for Structured Data Markup

    Schema.org is a Schemas for Structured Data Markup for creation of more easy semantic web which can be visualized form which fills the human-computer gap.

  • Schema.org Optimized WordPress Posts, Categories for Genesis

    Schema.org Optimized WordPress Posts, Categories for Genesis Theme Frameworks are easier to create than to fully work on making WordPress modern from scratch. Easier does not mean that you can create within one day. It might take few months, but the good work Genesis Theme Framework is still continuing is the addition of the microformats other […]

  • WordPress & PHP : Different AdSense Units on Mobile Devices

    Here is How To Serve Different AdSense Units on Mobile Devices on WordPress With PHP. WordPress Has Function Which Can Be Used In Free Way.

  • Genesis 2.0, YARP and Schema.org : Guide

    Genesis 2.0 is HTML5 based and YARP is one of the best related post plugin. Here is how to use Schema.org markup to tell search engines about the related links.

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

  • What is Web MiningDecember 3, 2023
  • Recursion in ProgrammingDecember 3, 2023
  • What is Iteration – MeaningsDecember 2, 2023
  • Implementation of Requirements in Electronic Archiving SystemsDecember 2, 2023
  • What is Database ArchivingDecember 1, 2023
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