WordPress.org

Support

Support » Plugins and Hacks » Changing the default schema type from WebPage to Article?

Changing the default schema type from WebPage to Article?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author bradpotter

    @bradpotter

    Sorry I missed your question.

    That is beyond the scope of my plugging however you can make a site-wide change with something like this in your Genesis child theme function file:

    add_filter( ‘genesis_attr_body’, ‘my_attributes_body’ );
    function my_attributes_body( $attributes ) {

    $attributes[‘itemtype’] = ‘http://schema.org/Article’;

    return $attributes;

    }

    Marj Wyatt

    @marjwyatt

    @bradpotter

    I added this code to a custom post type archive (is_page_template):

    add_filter( 'genesis_attr_body', 'vm_list_schema' ); // Customize Schema Markup
    function vm_list_schema() {
      $attributes['itemtype'] = 'http://schema.org/ItemList';
      return $attributes;
    }

    It didn’t work and threw out the styles I had written. So, I hard-coded the proper schema into my custom loop for that archive.

    But I remain curious. Would you have any answer as to why this didn’t work?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Changing the default schema type from WebPage to Article?’ is closed to new replies.