Hi there,
There are 2 ways of doing this. In both, we need to use a PHP snippet.
One is to include only the things you want by filtering it.
Example:
add_filter('wpsp_query_args',function( $args, $settings ){
if ( 1699 === (int) $settings['list_id'] ) {
$args['tax_query'] = array(
'relation' => 'OR',
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => array( 'campaigns','project-updates' ),
),
array(
'taxonomy' => 'post_tag',
'field' => 'slug',
'terms' => array( 'sample-tag-1' ),
),
);
}
return $args;
},10,2);
Just make sure you change the values.
Replace 1699 with the ID of your WPSP list. Replace ‘campaigns’ and ‘project-updates’ with your category slugs and replace ‘sample-tag-1’ with your tag slug.
Another way is by actual exclusion:
Example.
add_filter( 'wpsp_query_args', function( $args, $settings ) {
if ( 1821 === (int) $settings['list_id'] ) {
$args['category__not_in'] = array(1,8,49);
$args['tag__not_in'] = array(38);
var_dump($args);
}
return $args;
}, 10, 2 );
Replace 1699 with the ID of your WPSP list.