php - Limit custom taxonomy dropdown by custom post type -


i have 2 custom post types connected same custom taxonomy. on particular page needed filter 1 particular post type using filter created custom taxonomy. able dropdown of custom taxonomy using <?php wp_dropdown_categories( $args ); ?> noticed listed terms atleast 1 of 2 custom post types had post linked it.

here's example of i'm trying do:
1. have 2 custom post types: cars , bikes
2. have custom taxonomy (location)
3. on specific page, need filter post type cars using dropdown created taxonomy
4. problem i'm facing dropdown taxonomy location, lists locations posts bikes post type connected to. example, if have posts cars post type connected usa, uk, australia , post bikes post type connected brazil, dropdown custom taxonomy lists 'brazil' term though none of cars posts linked it.

is possible restrict dropdown taxonomies 1 custom post type?

i asked same question on wordpress stackexchange site , got answer. linking in case else interested in it: https://wordpress.stackexchange.com/questions/207655/restrict-taxonomy-dropdown-to-post-type


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -