See the Codex. The wp_list_categories
allows you to set a child_of
and a depth
(in this case 1, we only want to go one level down).
See the link to the Codex about styling it; there’s a whole host of options.
<?php $term = get_queried_object();
wp_list_categories(array(
'taxonomy'=>$term->taxonomy,
'child_of'=>(int) $term->term_id,
'hide_empty'=>0,
'depth'=>1,
)); ?>
I’ve only tested this on built-in categories, but this should work for custom taxonomies too.
Related Posts:
- Include and Exclude Taxonomies From Archives & Feeds Using ‘pre_get_posts’
- Check if current term is a child of another term
- How to hide custom taxonomy archives same way as hiding custom post types?
- How to pass posts_per_page and paged params query vars to custom taxonomy archive urls?
- Page queried instead of a custom taxonomy
- Using a different template per Custom Taxonomies for single term archive pages
- Creating an Archive using a Custom Taxonomy
- Date archive permalinks for custom taxonomy
- Taxonomy archive showing no results
- Dynamic loading of Archive content based on custom taxonomy term name
- List taxonomies according to whether this post is in another taxonomy in taxonomy archive
- orderby meta_value breaks taxonomy term archives
- Why is the custom taxonomy archive page redirecting me to a single post? [closed]
- How to have two different versions of a tag/category/taxonomy archive page?
- Automatically Give All Custom Post Types a Pre-Set Category [duplicate]
- How to add Post Format Taxonomy Archive page in the menu?
- How does WordPress Parent-Child Taxonomy actually Works?
- Custom taxonomy archive shows 404 error
- Custom Taxonomy index/archive hierarchy
- Filter custom taxonomy archive posts by 2nd custom taxonomy using select dropdown
- Custom Taxonomy Term Archive Page Template that Filters 2 or more Taxonomies
- How to use multiple archive templates for a taxonomy?
- how does the wordpress rest API work
- Taxonomy archive template that shows posts from more than one taxonomy
- Custom Taxonomy List with Children
- why the archive of custom taxonomy term shows nothing?
- Can I output a custom taxonomy as a submenu in the site navigation menu?
- Add terms to a taxonomy archive from within the same taxonomy
- Custom Taxonomies Archive Page 404
- How to create archive pages for metadata query generated posts (so without taxonomy)?
- How to create a completely functioning separate archive for posts from only 1 or 2 specific categories
- How to pass posts_per_page and paged params query vars to custom taxonomy archive urls?
- Hierarchical taxonomies in permalink cause 404 for sub term archive
- How to get a terms and posts associated with another term?
- Change the Page Title of the Archive Page for Portfolio Tags
- Custom taxonomy return 404
- What’s the url queryvar for a taxnomy archive?
- Multi level archive
- Custom Taxonomy Archives Page Errors
- index.php Not Showing Custom Posts / Terms
- Custom Taxonomy Archive Page for Parents AND Children?
- Redirect or Prevent Viewing of Custom Taxonomy’s Archives?
- Creating a Taxonomy Page [duplicate]
- Exclude 2 in 3 terms of A Taxonomy from all Archives
- Insert code on specific taxonomy archives
- Permalinks not working on MU network with domain mapping
- Custom Taxonomy Archive URL rewrite
- Can you orderby slug in a taxonomy archive page using WP_Query?
- More than one Hierarchical Taxonomy and SEO
- Getting Catategory / Taxonomy Description on Non-archive Pages
- Taxonomies starting with a hyphen (minus) to assign B.C. dates to a post
- Custom taxonomy archive empty
- Why my archive title isn’t showing?
- Creating a custom archive page for WooCommerce products based on tags
- Get term name from term ID?
- Can custom taxonomies be displayed inside of a custom meta box?
- Display child taxonomy until the last child
- URL rewrite rules for multiple taxonomies query
- Best practices for complex taxonomies
- wp_get_object_terms – How can I order the resulting array by hierarchy?
- How to display and use all existing tags at my write-post-at-frontend-panel?
- How to use create_term, edit_term, delete_term actions?
- Hierarchical display of custom taxonomy
- custom post type category page
- Advanced custom fields – taxonomy terms images [closed]
- WPML Translating a term/taxonomy programmatically
- Same taxonomy for different object types
- Enable the admin to sort custom taxonomy
- Translating a custom taxonomy
- Show all post of taxonomy on base taxonomy URL
- Taxonomies for custom post types
- Taxonomies image
- Redirect on saving term at custom taxnomy
- Pagination on Custom Tax Pages Removes Spaces from Query Vars
- Taxonomy Rewrite Rules Redirecting Instead of Masking
- Does using custom taxonomy is more CPU efficient than using meta_data?
- WP REST API – get custom taxonomies based on terms & filter
- Using WP_Query and Query_post for the loop?
- Multiple Custom Taxonomy Dropdowns Lists
- Double slash in the_terms URL
- Using custom taxonomy when registering a new custom post type
- How to call a custom taxonomy term name inside a function?
- Get custom taxonomy name (not the term) in custom post
- How to add custom content to custom taxonomy
- query to use to link to taxonomy single page
- Fix Custom Taxonomy Display two times on each call
- Saving custom taxonomies to post as checkbox on frontend
- How can I show links for custom posts group by taxonomy current term and sub-term?
- Show custom taxaomy as a product meta
- Rewrite Search URL Permalink For CPT Custom Taxonomies
- Updating a custom post type’s custom taxonomy in a custom editor block
- Template taxonomy-{taxonomy}.php doesn’t show my posts
- Custom taxonomy – no posts found
- How to truncate the description in the admin panel for a custom taxonomy
- Custom button on custom taxonomy listing page
- customize taxonomy Page
- Remove taxonomy menu without removing the metabox?
- Custom taxonomy list in Worpdress
- How can I show custom field according to taxonomy?
- get_term_children specific no id