Include custom post type custom taxonomies in Categories widget
I wanted to see if this was possible, but I want to include the custom post type custom taxonomy categories inside the WordPress Categories widget.
I know that there is a filter as shown below:
add_filter('widget_categories_args', function() {
$params['post_type'] = array('post', 'recipe');
return $params;
});
-
My taxonomy is called
recipe-categories
insidewp_term_taxonomy
and I want to be able to pull in all the categories inside the Categories Widget. -
recipe
is my custom post type. -
Url string is
taxonomy=recipe-categories&post_type=recipe
Here are all the categories that I have:
All that I’m getting back is the post
categories and not my recipe
categories as shown below:
Leave an answer