The ‘child_of’ argument lets you select subcategories from a parent category, and a you can get the current taxonomy id to pass as the value:
<?php
$category_id = get_queried_object_id();
$args = array(
'hide_empty'=>1,
'depth'=>1,
'hierarchical'=> 0,
'show_count'=> 1,
'taxonomy'=> 'portfolio-types',
'child_of' => $category_id
);
?>
<ul>
<?php wp_dropdown_categories( $args ); ?>
</ul>
So in the example above, only children (sub-categories) of portfolio-type of the current category ID will be displayed.
Note that this code will only work if you are in a taxonomy archive page, which I think that’s what you intend to do.
Related Posts:
- Filter get_categories() for taxonomy term in WordPress
- Categories of custom taxonomy don’t show any posts
- Exclude a category from WP_Query
- Custom Taxonomy as Dropdown in admin
- How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?
- 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
- Remove date and category filters when editing custom post types
- Glossary with Custom Post Type
- Custom-Taxonomy as categories: Remove “most-used” tab?
- Add filter to wp_list_categories and query what type of taxonomy-terms it use?
- Highlight nav menu terms
- Taxonomy list. Order by a specific custom post type count
- Want to filter only parent post in admin area
- Display custom taxonomy as dropdown list
- Filters post in admin with dropdown select, custom post type
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- What is better: Custom Fields vs Custom Taxonomies with Terms for perfomance, scalability and better user experience
- Taxonomy structure of Sport site
- Display Custom Category (taxonomy) Name in Custom Post Type
- Custom Taxonomy breaking pages permalinks
- Show Post Count of a Category
- 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?
- Filter categories of posts with checkboxes
- Insert HTML inside link in a walker
- Set menu active state for custom posttype and category, given custom taxonomy term
- How to query custom post types posts filtered by multiple custom taxonomies through a form selection
- Display all posts in main category and 1 subcategory
- Posts from all the categories are being displayed instead of particular category
- How to convert custom post type based list to a dropdown list?
- How can I see a list of my Custom Post Types of the last term I was in?
- 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?
- How to display custom taxonomies with links in filter menu?
- How to filter wp_list_categories output with some custom post type meta query?
- Cannot add category or custom taxonomy from admin. WordPress site is hosted in Windows 16 server via IIS. No XAMPP or WAMP
- How to Filter custom post type by taxonomy?
- Hide parent categories when clicked, and show it’s childs
- Limit amount of posts made within a custom taxonomy
- Sort and filter custom post type posts by custom taxonomy
- 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
- Categories filtering in new post
- dropdowboxes with pre-selected custom fields optios that filters the results according seach needs
- WP the_posts() on single-cars.php get category link
- in_category for custom post types
- List Posts By Custom Taxonomy
- Filter posts by tax (dropdown) and meta value
- get_category_link() for custom post type does not include custom slug rewrite?
- How to Display Posts From Category Within a Custom Taxonomy?
- Targeting categories in custom fields
- Listing all slugs?
- category list with cutom post count
- Include custom post type custom taxonomies in Categories widget
- Custom post type categories gives 404 error
- Filter By Category Dropdown List With Custom Taxonomies
- get_terms() parent, child and grandchild
- Get child categories of custom taxonomy category?
- Custom Post Type Custom Archive Page Not Working
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- Custom post types category
- Display Taxonomy Term Children in a Drop Down without Submit Button
- Get terms for a specfic post from multiple taxonomies in custom post type
- Can’t pull posts of a Custom Post Type based on the custom taxonomy of the CPT
- Custom post type specific category box
- Custom Taxonomy Taxonomies of Same Name point to first created URL
- Advanced archive url structure (category, tag and date)
- How to create Custom Taxonomy Search Drop Down for specific Post Type
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- How to show related posts of category on post within custom posttype
- Filter in Custom post type to find the parent post
- Create custom post type categories
- Show Custom Post Type based on Category on Archive Page
- Set a Default CPT taxonomy by taxonomy id
- How to manage a dynamic multi-level page hierearchy system?
- Insert custom taxonomy into category query
- Categories manage
- Custom category taxonomy – archive page not showing up
- Changing an item in drop down after 5 latest posts per taxonomy
- Help with Travel Guide Setup
- Custom post type category archive URL redirects to home page
- Help with Multi Level Category Archive Page
- Post Editor: display categories from current post type taxonomy only?
- Exclude Custom Post Type from shared Custom Taxonomy
- Get a list of categories ids
- Trying to create hierarchy between 3-4 custom post types
- Customize category URL
- How to filter posts by categories?
- Display a custom post type list by taxonomy term
- Return Custom Post Type Categories
- Highlight specific menu item when custom post is page
- How to add categories to a custom post type using wp_insert_post($new_post);