• Hi folks,

    I’d like to exclude some post categories from the slider.
    I configured it to show auto-generated form my posts.

    I’m importing some rss-feeds and give them a special categorie. I don’t want this category to be shown in the slider.

    How can I achieve this? For the front-page, i used the function.php in my child theme, using this code:

    function exclude_category_home( $query ) {
        if ( $query->is_home ) {
            $query->set( 'cat', '-4, -6, -62' );
        }
        return $query;
    }
    
    add_filter( 'pre_get_posts', 'exclude_category_home' );

    Looking forward for your answers,
    Jens

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to exclude categories from slider?’ is closed to new replies.