Yes this is possible with the code. It does require the ID of the category that you want to hide. You can find the category ID by clicking on it in the admin area, and then grab the value after tag_ID.
add_filter( 'wpsl_dropdown_category_args', 'custom_dropdown_category_args' );
function custom_dropdown_category_args( $args ) {
if ( is_page( 'your page name' ) ) {
$args['exclude'] = array( '1','2' ); // The category IDs.
}
return $args;
}
The code has to go in the functions.php inside your active theme folder.
-
This reply was modified 2 years, 6 months ago by
Tijmen Smit.
Thanks Tijmen, works perfect!
And if I want to hide the results for those categories if ANY/ALL is selected?