Try get_terms( 'product_cat', 'parent=" . get_queried_object_id() )
Update: Re-read your question, think I have a better idea:
<ul class="categories">
<?php
wp_list_categories(
array(
"child_of' => get_queried_object_id(),
'taxonomy' => 'product_cat',
'title_li' => '',
'depth' => 2,
)
)
?>
</ul>
Related Posts:
- How to order posts by title after they have already been sorted by category
- Show posts without term
- Display products from specific category in shop page
- Exclude Child Posts from WP_Query
- Show all products on one page with WooCommerce
- $wp_query initiation?
- Tracing the life of a query
- Why is my WP_Query not working when tax_query terms are an array?
- Get list of posts which have at least one term from a custom taxonomy with WP_Query
- Custom archive page based on array of categories and tags
- List taxonomy terms plus their latest post ordered by post date
- Get random terms
- WP Query for Posts (Products) in Specific Category that has 2 Specific Tags (*AND* both tags not *OR*)
- Order terms inside a select dropdown
- Woocommerce custom loop to show all the products [closed]
- List the 5 most recent child pages
- Get array of current post term ID’s
- How to add terms to my tax_query based off of the current post
- Change default ordering of taxonomy terms – pre_get_terms
- Empty tax_query array returns an empty array
- Pass array of taxonomy terms to wp_query
- Tell wordpress to show a single page instead of an archive
- Get list of terms that have posts in another term
- Formulate a url to show posts with both taxonomy terms
- Taxonomy search/filter with multiple taxonomies and multiple taxonomy terms
- Set order of returned items in the WP_Query() class/function
- Order by slug in get_terms with multiple taxonomies
- WordPress Related Post by tags in Single.php
- Function get_queried_object() return NULL in custom taxonomy
- List of the years with posts presented
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- List custom taxonomy terms sharing posts with a term from a second custom taxonomy
- Return Taxonomy/Term Information with Posts (WP_Query/get_posts)
- From where is archive.php getting its posts?
- Display posts from only one post form in custom query and exclude in main query
- Remove category from query (show all posts in archive.php) pre_get_posts()
- Get authors by term id or slug
- Two loops on archive page
- Filtering out child category posts from parent category archive not working
- WordPress query with items from more than one selfdefined taxonomy as `term` argument
- Better wordpress attachment query than this
- Taxonomy order exception for specific term
- Filter Custom Taxonomy Posts
- Get posts from multiple tax terms
- How to Order a list of taxonomies? orderby?
- get_the_terms – but only show 4 Posts
- Display if author page is author page of current user
- Count posts per taxonomy else change taxonomy if less than x number
- How to add custom meta to ‘pre_get_terms’?
- get term id from term name
- WP_Query to output chosen term and posts with no term assigned
- WP Job Manager plugin – Listing only the twelve job categories on frontpage order by jobs they have
- Filtering posts by archive showing all years
- Getting the post terms ‘wp_get_post_terms’ per post when within the functions.php file
- How to print term name inside wp post loop
- Using WP_Query for categories instead of get_terms
- Check if a post has term inside loop
- Grabbing taxonomy terms and inserting them into an array
- Creating attachments archive in tags and categories
- Post archive for certain post format
- Don’t repeat posts from children in parent taxonomy query
- Creating ‘posts page’ loop based on the page itself
- Deleting terms from the WordPress wp terms table
- How to make a query returning pages from multiple parents
- How can I build a query that returns all attachments of a page and it’s children pages?
- Can’t get term id for category archive
- How can I do a orderby by the number of items? So basically list by starting with the array with the largest number of post
- How to make a post with certain taxonomy term display first before other post with only one query?
- get_children() Archive Template
- In a WP_Query can I force the results’ is_singular() to be set to false?
- How can I order a post query’s results based on the number of matching taxonomy terms?
- Only show tag with the same id as the post
- display ACF repater field in archive page
- Save queried result into database
- Pagination not working on archive.php template?
- WP Query by 4 different taxonomies
- How do I stop the same post showing multiple times in a archive?
- Get categories within specific term
- How to display Woocommerce products list by tag
- Only return taxonomies that are linked to a category & product
- taxquery taxonomy get terms
- get term objects and post objects in query
- How to show terms from another taxonomy
- How to define a custom hierarchy for terms?
- WordPress custom query by archive title
- WP_Query doesn’t works inside loop
- In Product Category archives how to show Posts having same/similar prod_cat slug structure?
- Show full category tree for a year with all post titles?
- How to allow Readers to Select Post Order?
- Get X posts for all post types on Taxonomy term archive
- Add a custom variable to query page object
- How to get several fields from wp_query?
- How to add archives (with pagination) to page template?
- Do not show a custom post if it belongs to a certain custom taxonomy
- Main loop querying current template’s info only in custom category archive pages, not my posts
- the_excerpt() not working in custom archive
- Get access to all terms associated to each post that the wp_query loop displays
- How can I get taxonomy term name using term slug & post ID using build in WordPress function or class?
- I need to get all categories from a WP_Query
- taxonomy-{term}.php terms pagination returning 404 after a certain page