WP only display categories that contain posts from that post type

admin

Administrator
Staff member
In wordpress I've created 2 custom post types
Code:
Services
&
Code:
Work
which can use the wp default category and tag taxonomies.

On any given single post page I need to list the categories available for that post type.

I've tried using
Code:
$args = array( 'hide_empty' => 1, 'taxonomy' => 'category' ); wp_list_categories( $args );
to list only those categories with posts associated but the list doesnt take the post types into account.

How would I only list the categories being used by that post type?