Read a useful post on Ryan Fmeier’s blog today about adding custom microdata in Genesis child themes which I highly recommend you check out.
In this post, i’ll provide you with some working code snippets based on modifying Ryans code, which you can simply copy and paste into your child themes functions.php file.
Firstly, here’s a video conversation which includes some of the Genesis Developers discussing the latest framework update. It includes discussion about some of the new features as well as the benefits of using Genesis to output your HTML 5 markup as microdata.
The Discussion about how you can add custom schema in your child theme starts at the 20:35 mark with Nathan Rice.
If you watch this discussion on video, you can also get some insight into how the Genesis Developers work together.
Genesis 2.0 Round Table Video Discussion
Default Genesis 2.0 Schema
Here’s some real examples of the schema added to different elements already included in Genesis 2.0.
Schema | HTML Elements Attributed To |
---|---|
http://schema.org/WebPage | Add attributes for body element |
http://schema.org/WPHeader | Add attributes for site header element. |
http://schema.org/SiteNavigationElement | Add attributes for primary navigation & secondary navigation element |
http://schema.org/Blog | Add attributes for main content element |
http://schema.org/SearchResultsPage | Add attributes for main content element |
http://schema.org/CreativeWork | Add attributes for entry element |
http://schema.org/BlogPosting | Add attributes for entry element |
http://schema.org/Person | Add attributes for author element for an entry |
http://schema.org/UserComments | Add attributes for single comment element |
http://schema.org/Person | Add attributes for comment author element |
http://schema.org/WPSideBar | Add attributes for primary & secondary sidebar element |
http://schema.org/WPFooter | Add attributes for site footer element |
Add Custom Schema
This code includes the page i.d’s which you can change to your own. You could also use the page name or page slug in place of the page or post i.d.
Here’s a full list of all schema’s you can choose from based on your niche and the content you publish on your website.
How This Helps You
One of the greatest benefits of micro data, is the ability to create or customize a theme using schema specific to your niche. Custom schema will be included in future child themes StudioPress release. They have also developed niche specific child themes which include custom schema that they plan on releasing shortly after Genesis 2.0 is released.
An example of this would be a theme focused on food or the real estate market.
Genesis child themes can now output your HTML 5 markup as microdata which has several benefits. By adding niche specific schema, the content added to your theme should be better understood by the search engines.
Plugin for Non Genesis Theme Users
If your theme doesn’t support HTML 5 and include schema, you could install a plugin.
- 32 Code Snippets To Remove or Modify All Schema Microdata in Genesis
- Here’s a review of one plugin you can use to Add schema for specific micro data on your site.
- Learn more about Schema and the benefits of outputting your HTML 5 markup as micro data.
Hi Brad
I am trying to add the below scenario to a custom plugin forked from https://gist.github.com/rfmeier/5819442
The plugin should include geodata. Could you please help in describing how this can be implemented from within the plugin. My limited coding knowledge has me going around in circles for days now.
Regards,
Dale
You need to Pay the membership fee to get unlimited answers for 1 month http://wpsites.net/registration/