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
- How can I add the featured image functionality to a custom taxonomy?
- Share one taxonomy across multiple blogs in 3.0 [duplicate]
- wp_update_nav_menu_item() to insert categories
- Programmatically create product category and add thumbnail in woocommerce
- Admin Panel – Disable Moving Selected Terms To Top of Metabox
- How to order the get_categories result
- How to make custom taxonomy check boxes like ‘Categories’
- Create terms when registering taxonomy?
- Categories’ hierarchy in URL
- How to create non-unique sub-category slugs?
- How to get next previous category in same taxonomy?
- Display only deepest category on a single post?
- Get terms that are associated with products from current category
- How to add HTML5 ‘required’ attribute to wp_dropdown_categories() without JavaScripts?
- How to set hierarchical terms to a post using wp_set_object_terms
- Wrap a chosen category name with div
- Hierarchical display of custom taxonomy
- Count argument in get_terms has no effect on ouput/doesn’t work
- Connecting WordPress gallery to custom categories (taxonomy)
- How to query posts from specific authors and categories using WP_query?
- Add custom taxonomy under the category title
- Category tree is flattened inside admin upon saving
- How to get category URL with the slug?
- Categories vs. Page Site Organization
- How to get data about category in category.php
- Display Slug instead of Name
- ACF: Display category name using taxonomy field
- Taxonomy name repeating when showing 2 posts from each category
- New Categories Not Shown In the Post Edit Page
- Shortcodes not working in category or tag description
- Filtering multiple categories via the URL
- Display specific categories by ID
- Give a page priority over a category that has the same name?
- Add child category to parent on post creation and save
- Flat category URLs but retaining hierarchy?
- Custom taxonomy template for categories
- Wacky taxonomy in wordpress
- Question on using custom structures for categories
- How to modify the output of wp_terms_checklist when used within the built-in category metabox on edit posts?
- List just subcategory and products of active category page in Woocommerce
- Display only subcategories of a category and not sub-subcategories
- More efficient way to list posts by category [duplicate]
- How to schedule categories?
- Exclude categories by ID
- Using in ‘category_name’ in ‘$query->set();’?
- Copy post taxonomy?
- Setting selected term_id with wp_dropdown_categories?
- Posts not listing out sub category in hierarchy
- creating categories programmatically
- Post to inherit custom category background image from parent
- Update custom category fields front-end
- WP-CLI Add category as menu item main-menu
- get_object_term_cache duplicate terms after update to wordpress 6
- Category post count is not correct
- How do I edit the terms output args or array data?
- How can i change sort category view starting from child then parent, not alphabetically
- Filtering posts in category by tag URL
- How to remove parent category from child category url using wordpress rewrite rule?
- Bulk assign posts to a category using SQL (MySQL)
- Restrict retrieved terms by category?
- How to modify custom category field from front end?
- show only terms from parent category
- How get all media from a posts category by db?
- Different template for subcategories
- List Terms by category
- Grouping parent categories into sections
- Category base 404 – fix
- exclude parents from the_terms
- Assign a category by user and customize the edit-tags.php?taxonomy=category page
- Woocommerce custom taxonomy order
- Hook action when create new category [duplicate]