Support » Theme: Iconic One » Remove microformat hentry only in pages

  • Resolved alessdilivio

    (@alessdilivio)


    How to disable structured data (hentry) only in pages?, I found this function but I think should be a way to do it on the theme:

    <?php
    // Desactivar microformatos hentry de Paginas
    function remove_hentry( $classes ) {
        if ( is_page() ) {
            $classes = array_diff( $classes, array( 'hentry' ) );
        }
        return $classes;
    }
    add_filter( 'post_class','remove_hentry' );
    ?>
Viewing 1 replies (of 1 total)
  • Theme Author Themonic

    (@themonic)

    If you are asking how to use that function in theme, then paste the following at the bottom of function.php and assuming your function is correct it should work.

    function remove_hentry( $classes ) {
        if ( is_page() ) {
            $classes = array_diff( $classes, array( 'hentry' ) );
        }
        return $classes;
    }
    add_filter( 'post_class','remove_hentry' );

    Please take backup of function.php before trying this.

Viewing 1 replies (of 1 total)
  • The topic ‘Remove microformat hentry only in pages’ is closed to new replies.