WP List Category of one Custom Post Type

235 views Asked by At

I have 2 Custom Post Type:

  • Coupons
  • Enterprises

They share a taxonomy called "line_of_business".

I want to use wp_list_category() and show only the categories of "Line of Business" in Coupons.

My code:

$args = array(
    'show_option_all'    => '',
    'orderby'            => 'name',
    'order'              => 'ASC',
    'style'              => 'list',
    'show_count'         => 1,
    'hide_empty'         => 1,
    'taxonomy'           => 'line_of_business'
);

wp_list_categories( $args ); 

But the result returns "line_of_business" of the two custom post types. Including categories and quantity os posts.

I want just show from Coupons.

Example:

Line of Business:

  • Restaurants (8)
  • Drugstores (2)
  • Gyms (1)
  • Malls (2)

Coupons are not yet in all categories, they can be for example only in Restaurants (4) and Malls (2).

How can I set the $args for the query correctly?

0

There are 0 answers