Thesis Schema API

The Schema API has been simplified and enhanced for Thesis 2.2+. This document is no longer accurate for older Thesis versions.

Markup schema provides you with a way to add rich data to your web pages. This data is recognized by major search engines and may help your site rank better.

There are many different schemas, and Thesis includes some of the most commonly used ones by default:

  • Article
  • BlogPosting
  • CreativeWork
  • Event
  • NewsArticle
  • Product
  • Recipe
  • Review
  • WebPage

Tip: Most of our Skins ship with the BlogPosting schema enabled, but you can change this at any time by editing Post Box HTML options in the Skin Editor.

Even though Thesis has the above schemas enabled by default, you can add any other schema you want because the system is 100% extensible.

Adding Your Own Schema

The Thesis Schema API is extensible via a simple array filter. For the following example, let’s say you want to add the Photograph schema; here’s how that works:

function add_schema($schema) {
	$schema[] = 'Photograph';
	return $schema;
}
add_filter('thesis_schema','add_schema');

In the above snippet, Photograph corresponds to the official type (or class) name from the schema documentation.

After adding your new schema, you’ll be able to select it from the dropdown in the HTML options of any Post Box.