ThemeShaper Forums » Thematic


global query too deep

(1 post)
  • Started 10 years ago by treibstoff
  • This topic is not resolved
  1. treibstoff

    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 10 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.