Skip to content

Instantly share code, notes, and snippets.

@MaruscaGabriel
Created March 9, 2015 18:19
Show Gist options
  • Select an option

  • Save MaruscaGabriel/15ce3fdfbf72161ffc0d to your computer and use it in GitHub Desktop.

Select an option

Save MaruscaGabriel/15ce3fdfbf72161ffc0d to your computer and use it in GitHub Desktop.

Revisions

  1. Marusca Gabriel created this gist Mar 9, 2015.
    22 changes: 22 additions & 0 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    add_filter( 'genesis_attr_entry', 'prefix_attributes_entry_content', 15 );

    function prefix_attributes_entry_content( $attributes ) {
    unset( $attributes['class'] );
    unset( $attributes['itemprop'] );
    unset( $attributes['itemtype'] );
    unset( $attributes['itemscope'] );
    //* Blog posts microdata
    if ( 'post' === get_post_type() ) {
    $attributes['class'] = join( ' ', get_post_class() );
    $attributes['itemtype'] = 'http://schema.org/BlogPosting';


    //* If main query,
    if ( is_main_query() )
    $attributes['itemprop'] = 'blogPost';

    }


    return $attributes;
    }