• 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 798 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic 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

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe

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 (21K Followers)
  • Twitter (5.3k 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

  • How Startups Can Convince the Investors April 14, 2021
  • What to Know About the Cloud Storage Services for Smartphones April 13, 2021
  • WonderFox HD Video Converter Factory Pro Review April 10, 2021
  • What is the Maximum Cable Length Between Arduino/ESP32 and a Sensor April 8, 2021
  • Is the Blockchain Hype Running Out of Breath? April 7, 2021

 

About This Article

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

Source:The Customize Windows, JiMA.in

 

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Cookie Policy.

PC users can consult Corrine Chorney for Security.

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

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

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