i’m displaying all posts by category in my template and i was wondering:
is it possible to get a list of all tags used by that category?
i only found out how to make a tag-dropdown but it’s from all articles,
i couldn’t find out yet how to filter it by category – any ideas?
here’s the link
http://wphacks.com/how-to-display-wordpress-tags-dropdown-menu/
thx in advance
Late answer
There’s
get_terms()
here for that. No need for any custom queries.Maybe this is late but thinks it will help someone.
This is the code that gives you tags list for specific category
10 year later but still better than never…
Categories and tags are not tied to each other. They are both related to post / product. Therefore, you need to query for the all posts/product and grab their IDs, so you can then query for tags where product/post ID is with in this set of IDs.
See the query below for WordPress Posts:
See the example query below for WooCommerce Products: