You can get it like this
$terms = get_terms("my_taxonomy");
$count = count($terms);
if ( $count > 0 )
{
echo "<ul>";
foreach ( $terms as $term )
{
echo "<li>" . $term->name . "</li>";
}
echo "</ul>";
}
Otherwise you can also use like this
$term_slug = get_query_var( 'term' );
$taxonomyName = get_query_var( 'taxonomy' );
$current_term = get_term_by( 'slug', $term_slug, $taxonomyName );
$args_list = array(
'taxonomy' => 'item', // or use $taxonomyName for all taxonomies
'show_count' => true,
'hierarchical' => true,
'child_of' => $current_term->term_id,
'hide_empty' => '0',
'title_li' => '',
'echo' => '0',
);
echo wp_list_categories($args_list);
Related Posts:
- Using get_terms for custom taxonomy in functions.php
- wp_get_post_terms() returns WP_Error in functions.php but in template it works
- Adding a class to tag list in a function
- Make Categories a Dropdown Menu in Media Library
- Identical custom taxonomy slugs for same hierarchical children
- Is there a WP function to get taxonomy name from taxonomy_term_id?
- Get Comma Seperated Taxonomy Linked Terms and Last Child Separated By “&” Instead Of Comma
- Output a specific link in WordPress post if the single post’s category’s name contain certain word
- Possible to merge these two functions?
- Suggest Users basing on User taxonomy
- How add body_class from wp_termmeta
- Display ACF category image on archive and single template files
- Get URLs for AJAX Filter Checkboxes WordPress
- Using get_terms for custom taxonomy in functions.php
- I’m getting invalid taxonomy in init action
- Taxonomy On Index Page
- Only seems to be displaying one child when there are supposed to be multiple
- Get the ID of the page a menu item links to?
- Add container to nav_menu sub menu
- Disabling pingback and trackback notifications
- register_post_type for Pages?
- Paged Single Post doesn’t redirect to the main url after Removing Pagination
- Restrict user registration to emails on a single domain
- Call to undefined add_action() in theme’s functions.php
- How can I rename the WordPress AJAX URL? [duplicate]
- How to add a rel attribute to images that contains their categories?
- Is it possible to be more page/post specific with admin_enqueue_script?
- Can I use require() function in a template file?
- What is the most efficient method for loading widgets in functions.php
- Enqueue script o style only if a template part is loaded
- Can I pass two roles to the function get_users?
- Add external js file to footer with id
- password protected post policy
- How can I enable uploading excel files?
- Logout hyperlink within a sub-menu
- Change the HTML of the comment form that is generating somewhere from the core WordPress
- How to customly read JWPlayer’s “Playlist” items by using its “playlistid”?
- Twentyten Child Theme: header images display messed up in admin panel
- How to get the index number of the posts?
- Removing wp_login_viewport_meta
- Force the “Choose from the most used tags” meta box section to always be expanded
- Call WordPress function outside of WordPress
- Move Custom Fields on General Settings Page to New Location
- How to load parent theme template parts in child theme
- allow only one post in specific category
- ACF not showing
- Cannot modify header information – headers already sent (wp_redirect in functions.php)
- Javascript function not working when placed in Text Block
- Use html inside shortcode function
- How to remove comment count column in Posts inside the admin dashboard?
- Cannot declare function twice [closed]
- Running script based on Category
- Get array of metakey in all posts
- How do I hook into the container of wp_nav_menu?
- Remove links from the_content when using filters wp_trim_excerpt
- Unable to return values from function
- Function not working inside of a function in functions.php
- How to Use Global Variables Inside Header and Footer
- Redirect website domain (including all pages) to external URL after Popup message (few seconds)
- Where do I go to edit this area? [closed]
- Enable right click on WordPress site
- processing form data with ajax
- Check from functions.php if function exists in footer.php
- This code works, but the way I integrated it is breaking the media uploader. How can I integrate it properly?
- Email Exists ERROR into Ajax registration form
- How to overwrite template.php file
- Limit number of characters in different excerpts
- Facebook OpenGraph error, Call to undefined function wp_get_attachment_src()
- How to avoid saving empty data to sql while using add_meta_box
- How to assign php file(template) to several pages with same prefix page name/slug
- How to fix Function create_function() is deprecated in / themes
- Block all plug-ins from initiating redirection upon activation?
- How to display my comment count in the wordpress admin bar?
- How Can I Create a Friendly Slug for a Dynamic Page?
- custom error message for empty username and password using authenticate filter not working
- Modifying a WordPress Plugin
- I have an fatal error on my funcyions.php
- Get post_author email for Zapier Integration
- get_locale() is different from $locale
- Remove all video attachment, both files and post/postmeta from database?
- Remove the delete link from pages without a plugin
- save_post doesn’t correctly process function call with php class
- Custom download page
- How to include a hyperlink in the body text of a custom password protected form?
- Get title from IDs in a string
- uninstall a theme programmaticlly
- Dynamically generated Navigation Diagram using Custom Fields
- Update add_image_size
- Function to get the name in database table from the comma separated string
- Full size image option removing problem
- Limit length of headline in Editor
- Ajax call does not work for this custom code
- Force resize for all video content
- Way of getting queried loop before the query with a filter hook?
- Add the title of a widget as an ID – for anchor links
- Why my wp_enqueue_script doesnt work on some page?
- Need to use an external variable inside a function
- Trying to get this function to show below the content
- Correct php syntax to add an image in wp functions.php
- How to add more than one menu for logged in members?