The widget class uses wp_list_categories() which supports all the parameters for get_terms() like taxonomy which you can use to make the widget lists categories in a taxonomy other than category.
So your code would be:
add_filter('widget_categories_args', function( $params ) {
// $params['post_type'] = array('post', 'recipe'); // post_type is not a standard parameter for get_terms()
$params['taxonomy'] = 'recipe-categories';
return $params;
});
However, the widget only supports a single taxonomy because wp_list_categories() uses taxonomy_exists() which doesn’t support multiple taxonomies. Here’s the relevant code in wp_list_categories() which causes the limitation:
if ( ! taxonomy_exists( $parsed_args['taxonomy'] ) ) {
return false;
}
So if you want to use multiple taxonomies, then you’d need a plugin for that (i.e. one that provides a similar widget) or you can code your own widget class.
Related Posts:
- How to build a complex page structure
- Help with Multi Level Category Archive Page
- Custom post type single-{custom}.php not working
- Filtering a custom post type by custom taxonomy in archive template
- Exclude a category from WP_Query
- How to filter custom post types by custom category taxonomy
- Is there a way to use regular categories with custom post types?
- How to list all categories and tags in a page?
- remove support for ‘Categories’ for a custom post type
- Glossary with Custom Post Type
- Custom-Taxonomy as categories: Remove “most-used” tab?
- Filter get_categories() for taxonomy term in WordPress
- Add filter to wp_list_categories and query what type of taxonomy-terms it use?
- Taxonomy list. Order by a specific custom post type count
- Custom/separate categories for custom post type
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- Taxonomy structure of Sport site
- Display Custom Category (taxonomy) Name in Custom Post Type
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- Show Post Count of a Category
- Generate Shortcodes by Taxonomy
- Get categories and descriptions from custom post type
- Combining custom post type and post category
- Querying Term Posts in Loop
- How to create new category for custom post type?
- Insert HTML inside link in a walker
- Set menu active state for custom posttype and category, given custom taxonomy term
- Display all posts in main category and 1 subcategory
- How can I auto-assign a CPT post to category in a custom taxonomy when published?
- Posts from all the categories are being displayed instead of particular category
- Conditional Statement custom post type category
- Categories sorting
- Allow user to set custom order to a list of custom taxonomies?
- get_category_parents for custom post type taxonomy
- wp_list_categories() – current-cat class also inside posts?
- Help need making decision. Ads rotating site on wordpress
- Categories of custom taxonomy don’t show any posts
- How to display custom taxonomies with links in filter menu?
- Return the latest post from a custom Taxonomy and Post Type
- Cannot add category or custom taxonomy from admin. WordPress site is hosted in Windows 16 server via IIS. No XAMPP or WAMP
- Don’t know how to show custom taxonomies from a custom post_type
- Hide parent categories when clicked, and show it’s childs
- Limit amount of posts made within a custom taxonomy
- Can’t remove front from permalinks for custom taxonomy category page
- Display a grid of taxonomy terms at root taxonomy page
- Get unique superset of taxonomy terms from a list of custom posts in another hierarchical taxonomy
- How to have this permalink structure: post_type/postname/custom_inner_page
- How to get custom posts sub category link
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- Custom post types and category archive
- List of Posts and Categories
- How to produce a sub-page-system in WordPress
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Get parent category id from child category page for custom taxonomy
- How to add current custom taxonomy slug to body class
- How to Display Posts From Category Within a Custom Taxonomy?
- Disable custom taxonomy on admin bar
- Why does my taxonomy have a category style div id?
- how to get this tax_query working?
- Show Taxonomies with admin area for custom post type?
- The Difference Between Categories and Tags and Taxonomies and Terms
- Custom Post Type Categories URL not displaying posts
- Get child categories of custom taxonomy category?
- List child categories from parent category on custom taxonomy page
- Get terms for a specfic post from multiple taxonomies in custom post type
- Custom post not appearing under custom taxonomy category
- Custom post type category permalinks and archive pages
- how to organize my categories or should I do custom post types for some?
- Using get_terms() to list terms from one custom taxonomy AND from one specific built-in category
- How can I tell if I’m on a custom post type archive page?
- Can’t Get Parent and Child Categories of Custom Taxonomy to Display
- How to divide Subcategories into pages of parent category wordpress
- Custom front-end form for adding post – Category problem
- Custom post type 404 category page
- How to display custom taxonomy term specific post?
- How to search through all child taxonomies using WP_Query?
- Custom Post Taxonomy Template Not Loading Properly
- Show Custom Post Type based on Category on Archive Page
- How to display only child category post in related posts in custom post type?
- Custom category taxonomy – archive page not showing up
- Help with Travel Guide Setup
- Why get_posts() returns empty array while I am trying to get posts from some specific taxonomies and work properly with others?
- Custom post types not displaying per category
- Custom post type category archive URL redirects to home page
- How To Display Category list from Portfolio post type plugin?
- Dropdown switching subcategories portfolio
- Display custom Taxonomies same as listing Categories
- Organizing The Custom Post Type with Taxonomies / Parent Posts
- show custom taxonomies in hierarchy
- Display 2nd category, only once, as sub-heading, in the loop
- Category / Custom Post Type permalink issue
- Custom post type and custom taxonomy archive inaccessible
- Apply custom names for generic custom taxonomy name?
- Category names on CPT archive pages [closed]
- Remove slug from Custom Category Permalink + dual-category permalinks
- Show custom post type on post category page doesn’t work / breaks navigation
- Is it possible for post and custom post type to share a category base slug?
- WP Query filtering by custom category not showing all relevant posts
- ACF Pro simple Business Directory – Requesting assistance with created Templates and associated Functions.php Coding