Category removal – Portfolio Category:

It looks like that text is coming from your theme. I would create a child theme (you’ll only need style.css to start with), then copy whatever file it’s coming from (probably header.php but could be in another file, possibly single.portfolio.php) into your child theme. From there, remove the whole section of code that looks something … Read more

Add subcategories posts to the counts column at the admin’s categories list

You can change an array of get_terms() arguments with two filters: get_terms_defaults filters the terms query default arguments; get_terms_args filters the terms query passed arguments. For example, this code will change the default value for the pad_counts parameter for all queries related to categories and called from the administrative part of the site. add_filter( ‘get_terms_defaults’, … Read more

How to apply wordpress ‘with_front’ = false for categories?

The register_taxonomy_args filter should do the job intercepting the arguments for the specified taxonomy: add_filter( ‘register_taxonomy_args’, ‘cyb_modify_category_args’, 99, 2 ); function cyb_modify_category_args( $args, $taxonomy ) { if( ‘category’ === $taxonomy && is_array( $args ) ) { $args[‘rewrite’][‘with_front’] = false; } return $args; }

Exclude category from WP_Query args not working

After a lot of searching I ended up finding this option that worked: Adding one exclude parameter to the get_terms list at the top. Like this: $tourDateArtists = get_terms( array( ‘taxonomy’ => ‘category’, ‘hide_empty’ => false, ‘exclude’ => ‘1’, ) ); Still not sure why neither ‘cat’ => ‘-1’, nor the particular tax_query param I … Read more

Hide post category name wherever it might be mentioned

Yes, you can use the wp_get_object_terms filter to remove the hidden category from any list that uses default WordPress methods like wp_get_post_categories(). add_filter(‘wp_get_object_terms’, ‘wpse_remove_unwanted_category’, 10, 4); function wpse_remove_unwanted_category($terms, $object_ids, $taxonomies, $args) { // we’re only interested in category, if this is another taxonomy if ($args[‘taxonomy’] !== ‘category’) { // return early return $terms; } // … Read more