Home › Toolset Professional Support › [Resolved] Hide Uncategorized term in View of taxonomy terms
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
This topic is split from https://toolset.com/forums/topic/create-graphical-taxonomy-grid/
Related documentation:
This topic contains 1 reply, has 2 voices.
Last updated by Christian Cox 6 years ago.
Is there a way to hide the uncategorised item in all these views?
You can remove the uncategorized term from all posts, specify a different default term for Posts in wp-admin > Settings > Writing, and delete the term from the site completely. Or, you can use custom code to suppress this term in Views of this taxonomy. I have a code snippet that will help. Add this to your child theme's functions.php file, or to a new snippet in Toolset > Settings > Custom Code:
add_filter( 'wpv_filter_taxonomy_query', 'prefix_modify_tax_query', 10, 3 ); function prefix_modify_tax_query( $tax_query_settings, $view_settings, $view_id ) { $views = array( 222, 333, 444 ); if( in_array($view_id, $views) ) { $tax_query_settings['exclude'] = 1; } return $tax_query_settings; }
Change 222, 333, 444 to be a comma-separated list of the numeric IDs of all the Views where you want to hide the Uncategorised item. If the Uncategorized term ID isn't 1, you must also change 1 to match the correct term ID. Usually it's 1 unless you change it. You can find a term ID by hovering over the term name in the wp-admin list of terms for this taxonomy.