How to Exclude a Category from Spectra’s Post Carousel

[ad_1]

Hi, I have a post carousel in my website and I’m using Spectra as a block builder, the question is: Can I select or at least exclude some categories from the carousel? With the default selectors you can select one category or all. I need to exclude some.

Any clues?

[ad_2]
1 Comment
  1. Reading this: https://wpspectra.com/docs/filters-actions-for-post/

    Seems like something like:

    function filter_post_query( $query_args, $attributes) {
    // Modify $query_args values.
    // Ex.
    $query_args[‘category__not_in’] = 5;
    return $query_args;
    }
    add_filter( ‘uagb_post_query_args_grid’, ‘filter_post_query’, 10, 2 );

    Being ‘5’ the category you want to exclude.

    Probably need more information to do it right but I hope this will help you-

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer