OK, so if the empty terms shouldn’t be displayed in there, then it’ll be pretty easy 😉
All you have to do is to use wp_list_categories function:
<ul>
<?php
wp_list_categories( array(
'taxonomy' => 'sfcategory',
'title_li' => false,
'hide_empty' => true // or false, as you wish
) );
?>
</ul>
Related Posts:
- Is There a Difference Between Taxonomies and Categories?
- Check if a post is in any child category of a parent category
- How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms
- How to display non-hierarchical taxonomy as terms with checkboxes?
- Control term order on a per-post basis
- How can I select a primary category?
- Does WordPress Offer a Way to Find All of the Categories that Don’t Have Children?
- Add custom taxonomy terms to WordPress menu dynamically & append #slug to url
- Display empty taxonomy terms with get_terms()
- List Terms in Category
- How can i insert term in a specific language of Polylang?
- Why does the argument list_only do on Walker_Category_Checklist::start_el?
- Display Posts Loop for each parent and for each Child
- Is There a Difference Between Taxonomies and Categories?
- Get posts under a category with SQL
- get_terms function not returning anything
- Display custom taxonomy attached to the post on post single page
- Display sibling categories on category page
- Combining these queries? (Same taxonomy term + same category as post)
- Show subChild categories
- Parent Category and Subcategory default text generated with category
- Get WooCommerce product category list in functions.php
- Display List of Categories Within a Custom Taxonomy
- get_adjacent_post_link excluded_terms ignored
- Why is my post categories not displaying?
- Problem importing categories and sub-categories
- Taxonomy term RestApi data 10 rows limitions
- List the category tree of all the product_cat categories
- hide_empty property not working when using get_terms
- get_terms vs. get_categories: does it matter?
- Woocommerce get category image full size
- Fixing category count
- Can a Child Category Have More than One Parent?
- Combine two taxonomies in a hierarchical tree
- Different template for subcategories
- Elegant way to add parent categories?
- Are Categories, Tags and Custom Taxonomies any different in regards to SEO?
- Excluding posts from a category but only if they’re not in multiple categories
- How to only show posts on last child category
- Update term count using a callback function
- Getting WordPress custom taxonomy/category?
- Return category slug / title from category ID
- How to get the number of child categories a specific parent category has?
- Get term by slug in Gutenberg
- How to get the depth of a category’s subcategories
- Add Product categories to WordPress menu without losing hierarchy
- Best way to programmatically link to multiple categories (union/intersection) [closed]
- Want to hide some categories from the categories meta box in the post editor for the two specific user roles
- Taxonomy filter all children
- How to enable category hierarchy for links?
- How to display terms from a custom taxonomy in a hierarchy AND with custom html markup?
- How to get the id from the custom category?
- Combining post categories and link categories?
- How to filter out Categories for specific post types on WordPress Admin?
- How to “group” (categorize) the Pages together?
- How can I edit the ‘Most Used’ tab in the categories meta-box to show another custom taxonomy?
- Custom taxonomy/category order
- Why don’t posts show up in my categories on the frontend?
- Get posts from specific taxonomy term
- How many categories can WordPress handle before performance suffers?
- Targeting Parent Category Pages
- Include WooCommerce product to all child categories
- Notice: Trying to get property of non-object in : custom fields category
- WordPress list categories dropdown with parent-child relation and child under it’s parent
- How to Link to Most Recent Custom Post of Same Term
- WP REST API not retrieving all categories
- Some categories missing on wp-admin/edit-tags.php?taxonomy=category
- Eliminate word from $term->name
- How to schedule categories?
- Showing HTML if Post is In Certain Taxonomy Term
- Copy post taxonomy?
- How to load several hierarchical categories from functions.php
- Check is category parent with ids from the childs – get_term_children
- Posts not listing out sub category in hierarchy
- list all child categories that apply to current post even if those cats are empty?
- How to get posts using category slug in ClassiPress?
- Add properties to term object
- get_object_term_cache duplicate terms after update to wordpress 6
- Disable Category Taxonomy
- Sort categories by custom field in WordPress admin
- How to set acf color field as background color to product category
- How to target all woocommerce categories that don’t have any subcategories in them?
- Replace deprecated get_category_children code with get_terms
- Filtering posts in category by tag URL
- Number of categories slowing down the site
- Image Upload Custom Form Field for Category and Custom Taxonomy
- How to define a custom hierarchy for terms?
- Add subcategories posts to the counts column at the admin’s categories list
- How to echo Tags and Categories as plain text
- Get category of a taxonomy for a queries object in a loop
- List Terms by category
- How to add a new child category via an SQL statement?
- Taxonomy for custom post type not found
- Children categories not shown in dashboard
- Use get variable when rewritten url in wordpress
- Assign a category by user and customize the edit-tags.php?taxonomy=category page
- Issue on Listing Sub Product Categories In Woocommerce
- Images as Categories
- Quick Edit on taxonomy names results in error
- Two related taxonomies. how to filter terms in second taxonomy depending on selected term in first taxonomy on Post edit page?