I don’t know why that code didn’t work for you. I copy that code and it work exactly as I expected. You should double check your case, did you unset $args
variable before, or you can use another name ($agrs2 for example).
Another problem in you question is: if pad_counts
doesn’t work, you will get 1 not 3.
Related Posts:
- If product is in sub-category show code
- How to show a hierarchical terms list?
- get_posts assigned to a specific custom taxonomy term, and not the term’s children
- Get the the top-level parent of a custom taxonomy term
- What is ‘term_group’ for ‘order_by’ in get_terms()?
- Check if a post is in any child category of a parent category
- Order get_terms by term meta
- Display all the subcategories from a specific category?
- Get parent id by term id
- How to get_term_children output in alphabetical order?
- When to / not to use wp_get_post_terms vs get_the_terms?
- Determine Term depth
- Why does WordPress combine a term with the same name in the wp_terms table?
- Correct use of get_the_terms()
- Get multiple term IDs by slug, and then exclude them in get_terms
- wp_list_categories: order by term order?
- Child terms from multiple parents?
- I have a term_taxonomy_id — is there an API call to get the taxonomy?
- Exclude Child Terms From Parent Posts
- same taxonomy for several post types: how to hide empty in a specific post type?
- How to sort terms with diacritical signs?
- wp_set_object_terms creates relationship to REVISION?
- get_terms(); show private posts when logged in
- Get category ID after wp_insert_term
- Get taxonomy name of current post
- How do I access a single term from a post?
- Prevent Selected Terms Rising to the Top
- How to order get_term_children output by alphabetic order
- Determine if Term has Grandparent/Great-Grandparent
- Custom Taxonomy Only Showing Top Level Terms in Admin?
- Child pages on hierarchical Custom Post Types 404s
- Is there any difference between post in child term and child & parent terms?
- How to update incorrect post count in taxonomy?
- Term begins with a letter
- get_post_terms not working as expected
- How to get the top most term (top ancestor) of a custom taxonomy child term?
- wp_update_term not creating new unique slug
- How to set hierarchical terms to a post using wp_set_object_terms
- Hierarchical display of custom taxonomy
- has_term() does not return when term is assigned post?
- List post from current taxonomy children
- get_terms() but with additional dimensions?
- Wp set post terms not work
- how is it possible that using wp_insert_category throw a fatal error?
- How to Get All Taxonomies AND All Terms For Each Taxonomy With Post Count Zero
- get_terms only show term if there is a post using it
- Get post terms for multiple posts at once?
- wp_update_term: How could i update the “name”?
- How to create drop down for child categories of current taxonomy being viewed?
- Get the Term List – Ordering
- Reduce / optimize calling of wp_get_object_terms() when generating permalinks
- Check if an array of posts has posts from a specific category
- Get only one product category woocommerce
- How to trace/fix false $term->count, rogue term relationships?
- How to order and count get_terms by specific post type?
- Get those terms with a specific meta key value
- get_terms() order by term_meta
- Difference between get_category, get_term_by and get_categories
- get_terms() for custom taxonomy related to another taxonomy
- get_terms from registered taxonomies not working
- get_term_children returns WP_Error for custom taxonomy
- Display hierarchical subterms of custom taxonomy based on depth
- What is the term shortlink structure?
- get_term_by “name” not working with & in name
- I want to loop through Woocommerce Product Catogories and show them in dropdown
- Invalid argument supplied for foreach() in search.php
- setting taxonomy term to bulk posts using ids
- Do I have to set parent when set post term?
- How do I determine if a certain term is in an array?
- Modify automatically generation of slug when term is created
- Display custom taxonomy on single post
- get_terms ‘number’ parameter does not appear to work
- Does get_terms() use any sort of caching on its query?
- Question with get_the_term_list
- Group child category IDs based on their parent category
- 404 on term taxonomy archive pagination only with some terms
- Clone Terms of one taxonomy to another
- Custom Template for one Taxonomy Term
- Unset actions for terms parent only
- Get random out from get_terms()
- How to show all possible parents and children of a hierarchical taxonomy term?
- Create / Close Div in Array [closed]
- Sort order by slug for looped child terms of custom taxonomy
- Conditional based on number of specific custom taxonomy terms in archive.php
- How can I get this custom post type permalink structure? %custom_post_type%-%taxonomy%-%term-postname%
- Categories order with get_terms_args not working in 4.7
- Getting all categories even with no products under it?
- Sticky posts per category
- Custom while loop for hierarchical display of a taxonomy
- Faceted search with WP-API data
- Show List of Terms (not posts) that have been Recently Updated?
- import_id parameter for wp_insert_term to create custom ID for category
- Hierarchical Taxonomy Terms Select Menu Output with selected=”selected” Set
- Programmatically add posts add and assign postmeta and assign terms
- When using the get_terms and trying to order the terms using the ‘order’ and/or ‘orderby’ does not work
- Rewrite rules for varying nested terms of custom taxonomy
- List Posts For Terms Of A Custom Taxonomy For Any Post Type
- get_terms – name__like a number
- Query to get term id using post id?
- Why does wp_get_object_terms add a period after terms are output?