{"id":8825974,"date":"2017-02-20T15:05:19","date_gmt":"2017-02-20T15:05:19","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/get-all-categories-that-are-associated-with-tag-archive\/"},"modified":"2017-02-20T15:05:19","modified_gmt":"2017-02-20T15:05:19","slug":"get-all-categories-that-are-associated-with-tag-archive","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/get-all-categories-that-are-associated-with-tag-archive\/","title":{"rendered":"Get all categories that are associated with tag archive"},"content":{"rendered":"<p>Hi!<\/p>\n<p>I&#8217;m building a bike site that has multiple bike brands and I&#8217;m using tags for the brand names. So for example there are tags like &#8220;trek&#8221; , &#8220;raleigh&#8221; and &#8220;scott&#8221;<\/p>\n<p>Then I have categories for bike types like &#8220;mountain bikes&#8221;, &#8220;road bikes&#8221; and &#8220;city bikes&#8221;<\/p>\n<p>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. <\/p>\n<p>So let&#8217;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.<\/p>\n<p>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.<\/p>\n","protected":false},"template":"","class_list":["post-8825974","topic","type-topic","status-publish","hentry","topic-tag-categories","topic-tag-filter","topic-tag-tags"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/8825974","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/8825974\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=8825974"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}