Thesis Schema API

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

Do what you want! Even though Thesis includes the above schemas 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:

add_filter('thesis_schema', 'add_schema');

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

Add this code to your master.php or custom.php file.

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 options of any Post Box, Post List, or Query Box.