Why does my custom taxonomy show a total count across all post types

There is currently a trac ticket on the fact that taxonomy counts are global (include all post types). Related trac ticket. To fix this you can remove the column and add your own using the manage_edit-{$taxonomy}_columns filter: add_filter(‘manage_edit-season_columns’,’my_season_columns’); function my_season_columns($columns){ unset($columns[‘posts’]); $columns[‘cpt_count’] = ‘Races’; return $columns; } You then tell WordPress what to fill this … Read more

Getting the Intersection of Two Custom Taxonomy Terms for a Custom Post Type?

As of v1.3, the Query Multiple Taxonomies plugin works great with WP_Query. Your original args work as is. $args = array( ‘post_type’ => ‘portfolio’, ‘numberposts’ => -1, ‘project_type’ => ‘A’, ‘package’ => ‘A’ ); Then make a new query and check it: $foo = new WP_Query($args); var_dump($foo->posts); I tested this on my own custom taxonomy … Read more

Is there a way to ‘Lock’ a Taxonomy?

Categories, Tags & Taxonomies First i want to make this one clear: Everything is a Taxonomy. Tags is a non-hierarchical, Categories a hierarchical and both are built-in taxonomies. Same goes for eg. post formats (aside, chat, etc.). It’s the same concept as with post-types (post, page, attachment, nav_menu_item, etc. are all just built in post … Read more

Exclude Specific Term from Search

The basic explanation You have a template tag that is called is_search() to determin if you’re on a search page or not. This then calls get_search_template() which basically is a wrapper function for get_query_template(‘search’). When you look into the last function, then you’ll see that it basically does locate_template(), which checks for file existence and … Read more

Combining Multiple Taxonomies in one URL

This rewrite rule should work (assuming “brand” and “type” are the taxonomy registered names): function custom_rewrite_rules() { add_rewrite_rule(‘^brand/(.*)/type/(.*)?’, ‘index.php?brand=$matches[1]&type=$matches[2]’, ‘top’); } add_action(‘init’, ‘custom_rewrite_rules’); Remember to flush the rewirte rules after saving this code in your site. Then you will need to hook in several places to fix things. For example, you may need to hook … Read more