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
- Saving Taxonomy Terms
- Filtering a custom post type by custom taxonomy in archive template
- Exclude a category from WP_Query
- Custom Taxonomy as Dropdown in admin
- How can I list all the categories under a Custom Post Type (taxonomy)?
- How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?
- How to build a complex page structure
- wp_dropdown_categories in custom post type with custom taxonomy
- 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?
- Ajax filter with custom taxonomies
- Filter posts with ajax form and checkboxes
- Add filter to wp_list_categories and query what type of taxonomy-terms it use?
- Conditional two level dropdown filter for custom post type
- Custom edit post column – category not showing
- Highlight nav menu terms
- Help with issues on “Adding a Taxonomy Filter to Admin List for a Custom Post Type?”
- Taxonomy list. Order by a specific custom post type count
- Want to filter only parent post in admin area
- How to show custom taxonomy in the permalink?
- Display custom taxonomy as dropdown list
- Filters post in admin with dropdown select, custom post type
- Custom post type taxonomy template
- Custom/separate categories for 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
- get_categories() for only CPT
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- Show Post Count of a Category
- Filter custom post type archive page with custom taxonomies (categories) with AJAX
- custom taxonomy archive by year
- Get categories and descriptions from custom post type
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- Combining custom post type and post category
- Querying Term Posts in Loop
- How to create new category for custom post type?
- Weird problem happening with custom taxonmy when creating/updating posts
- Filter categories of posts with checkboxes
- Insert HTML inside link in a walker
- Custom Post Types and independent Categories – complex Taxonomy
- Should I use custom taxonomy or custom post type
- How to detect filter in URL in Category page?
- 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
- Custom Post Type Archive Page Filtering
- How can I auto-assign a CPT post to category in a custom taxonomy when published?
- Genesis filterable portfolio isotope [closed]
- 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
- Custom Post Type With Categories
- Categories sorting
- Allow user to set custom order to a list of custom taxonomies?
- get_category_parents for custom post type taxonomy
- Displaying custom taxonomy in the admin list of a custom post type
- wp_list_categories() – current-cat class also inside posts?
- How to display custom taxonomies with links in filter menu?
- Show a Category X’s custom post type on Category X archive page?
- Multiple level category drop-down from the WordPress dashboard
- WordPress sort search results by custom order
- 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
- Filter term taxonomy metabox in custom post type
- Filter CPT posts by one or more categories
- Getting categories of posts under a custom taxonomy
- Can’t remove front from permalinks for custom taxonomy category page
- How can I made custom taxonomies relationship?
- Sort and filter custom post type posts by custom taxonomy
- How to edit this code to get the categories in achieve page?
- Hierarchy and access control for Custom Post Types (CPT)
- Loop filtering Custom Post Types and/or Categories
- Best method to make posts searchable, sortable and filterable – custom field, tag or category?
- How to get custom posts sub category link
- How to make custom taxonomy into drop down select in a custom metabox
- browse by category and tags?
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- Categories filtering in new post
- List of Posts and Categories
- dropdowboxes with pre-selected custom fields optios that filters the results according seach needs
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- WP the_posts() on single-cars.php get category link
- Create new custom post and post category of same name
- in_category for custom post types
- Get parent category id from child category page for custom taxonomy