ThemeShaper Forums » Thematic

global query too deep

(1 post)
  • Started 1 year ago by treibstoff
  • This topic is not resolved
  1. treibstoff
    Member

    I'm using follwing function to exclude some Categories from the index, the archive & the Search:

    add_filter( 'pre_get_posts','remove_cat_from_home' );

    function remove_cat_from_home( $query ) {

    if ( is_home() || is_archive() || is_search() )

    $query->set( 'cat', '-1,-30,-37' );

    remove_filter('pre_get_posts','remove_cat_from_home' );

    return $query;
    }

    this works but a little bit too deep.
    Those excluded categories are also excluded from the TAG search....sic!

    What can I do???

    best regards thomas

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.