Hide empty categories on widget
Hide empty categories on widget
Hide empty categories on widget
taxonomy-{term}.php terms pagination returning 404 after a certain page
WordPress taxonomy and terms question
post_type_link not working for posts without terms
It sounds like you’re looking for get_ancestors(). In your case, something like get_ancestors( $term_id, ‘product_cat’, ‘taxonomy’ ); should get an array of ancestor (parent, grandparent, etc) IDs for a given $term_id.
Foreach for get_the_terms for hierarchical taxonomy don’t repeat Top Level Terms if contains multiple Second Level Terms
Woo – Change order status by category [closed]
This code gets all the products parent categories, get_categories its somehow faster than get_terms. if then want the subcategories its just put one more if inside after the echo $cat->name; and so on, before this endif. and its also not showing the empty categories, if it is to show all, just remove the ‘hide_empty’ => … Read more
You can do that using a subpattern or capturing group like ([a-z]) in your rewrite rule’s regex (i.e. regular expression pattern, which is the 1st parameter for add_rewrite_rule()), and then use $matches[<n>] in your query (the 2nd parameter for add_rewrite_rule()), where <n> is a number (1 or above) and it’s the subpattern’s position number. Why … Read more
Unable to import term_meta in wordpress using wp_cron