get_categories()
only lists categories, so you shouldn’t be seeing any terms from the custom taxonomy. What you want to use is get_terms()
which takes a taxonomy as an argument. As you can read about in this answer, get_terms()
is actually used by get_categories()
, it just prefills the “taxonomy” argument with “category.”
If you swap in get_terms()
and add the name of your custom taxonomy, your code looks like it should work. The only other thing you may be able to change is your if
statement checking the category count. If you’re already doing 'hide_empty' => 1
you shouldn’t need that.
Related Posts:
- Order get_terms() By Custom Field
- How can I select a primary category?
- Are Categories, Tags and Custom Taxonomies any different in regards to SEO?
- Removed slug from CPT, now How/where do I hook the filter to the taxonomy term archive pages link?
- Display empty taxonomy terms with get_terms()
- Get a list of Terms for a specific category
- Limit number of terms that a custom taxonomy can save per custom post type
- Get posts from specific taxonomy term
- Display custom taxonomy attached to the post on post single page
- Ive got a term (get_term_by) but now I want to filter it by a category it is in?
- Showing HTML if Post is In Certain Taxonomy Term
- Post to inherit custom category background image from parent
- List taxonomy terms assigned to a post in hierarchical view
- Ordering terms whilst in loop
- Get WooCommerce product category list in functions.php
- Display List of Categories Within a Custom Taxonomy
- List Terms by category
- 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
- Can’t custom taxonomies have same terms (slugs) as categories?
- get_categories for custom post type with a specific custom taxonomy attached
- How can I add the featured image functionality to a custom taxonomy?
- How can I get category ID by category name?
- Programmatically create product category and add thumbnail in woocommerce
- How to order the get_categories result
- Show Post from parent category (custom taxonomy) ONLY!
- Glossary with Custom Post Type
- How to get next previous category in same taxonomy?
- Get terms that are associated with products from current category
- Use get_term_children to get the sub category of a parent category for the current post
- Update wordpress post terms programatically
- Are Custom Taxonomy Templates Possible?
- How to display a description of a given category from a custom taxonomy
- get / list categories and counts filtered by custom taxonomy term
- Category tree is flattened inside admin upon saving
- PHP Fatal error: Cannot use object of type WP_REST_Response as array in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
- How to know if it’s a child taxonomy?
- List Terms in Category
- wp_dropdown_categories and custom taxonomy + custom post type
- How do I get a list of all categories that a given user has written blog posts for?
- Set post categories to include parents when setting child category
- Inserting Category programmatically
- Allow user to set custom order to a list of custom taxonomies?
- One Specific Category To Permalink
- Why does the argument list_only do on Walker_Category_Checklist::start_el?
- add_rewrite_endpoint returns 404 on archives
- Add category only if post has custom taxonomy category
- How to get custom posts sub category link
- Add child category to parent on post creation and save
- Get Number of total Parent Categories for Custom Taxonomy
- Get posts under a category with SQL
- Limit categories and it’s subcategories for specific group of users
- wp_dropdown_categories not showing option as selected
- Question on using custom structures for categories
- add slug beside name in Admin Category Checklists
- How to Display Posts From Category Within a Custom Taxonomy?
- Target a specific category from a custom taxonomy?
- Display sibling categories on category page
- Count tags for a specific category
- custom page for custom Taxonomy
- Filter By Category Dropdown List With Custom Taxonomies
- query_posts by category_name and custom taxonomy
- More efficient way to list posts by category [duplicate]
- Exclude categories by ID
- Using in ‘category_name’ in ‘$query->set();’?
- How to store category and tags separatly on wordpress?
- WordPress custom taxonomy
- wp_delete_term or wp_delete_category?
- Update custom category fields front-end
- Combining these queries? (Same taxonomy term + same category as post)
- 3.1 post formats and specific categories/custom taxonomies
- Link posts together (relative, not grouped)
- WP-CLI Add category as menu item main-menu
- get_object_term_cache duplicate terms after update to wordpress 6
- How to fix select filter on category
- Migrate the posts of a category to another blog as a custom taxonomy
- List of post categories only associated to another custom taxonomy
- Taxonomy custom check box meta field not getting saved
- Can’t display posts by filtering categories using isotope.js
- Grab all the posts for particular category
- How to remove parent category from child category url using wordpress rewrite rule?
- Restrict retrieved terms by category?
- How to modify custom category field from front end?
- How to assign Categories and tags inside the TinyMCE Editor for each Image?
- outputting taxonomy hierarchy
- Bulk Change WordPress category Slug
- Why use hierarchical taxonomies instead of many custom taxonomies?
- show only terms from parent category
- Getting a sub category based on a category name
- How to Manage and link certain custom taxonomy?
- get_adjacent_post_link excluded_terms ignored
- Get a list of categories ids
- Most efficient use of custom taxonomies, categories, and pages
- exclude parents from the_terms
- Converting Categories (with ACF fields) to custom taxonomies
- get_category_children/ the new get_term_children not work
- Taxonomy term RestApi data 10 rows limitions
- hide_empty property not working when using get_terms
- Taxonomy page wpml dropdown not working