Get all categories that are associated with tag archive
-
Hi!
I’m building a bike site that has multiple bike brands and I’m using tags for the brand names. So for example there are tags like “trek” , “raleigh” and “scott”
Then I have categories for bike types like “mountain bikes”, “road bikes” and “city bikes”
So I can list bikes by brand or by type and it works without problems. The problem comes when I am in the tag archive page and I want to filter the posts by category in the tag archive by showing buttons/dropdown with all categories that have posts with the current tag.
So let’s say there are ten mountain bikes and five road bikes from brand Trek but no city bikes, so I want to hide the city bike category link as long as there are no bikes by Trek in that category.
Any ideas how could I do that? I can only find solutions that work for a single post but nothing for all post listed in the archive page.
- The topic ‘Get all categories that are associated with tag archive’ is closed to new replies.