How can you hide empty categories when displaying posts within categories
-
Hi there!
Thanks for this really handy plugin.
I’m having an issue though with my string and I was wondering if you could help?
I have a content type called ‘portfolio’ which has multiple categories (and a ‘status’ taxonomy which seems to work with my code below), and I’m building an jQuery accordion with that, to click on the category title and see everything within that category. Currently the accordion and query works perfectly, however, I can’t seem to hide a category title if there is nothing in that category. I was under the impression that the ’empty=false’ parameter should hide an empty category.
Am I doing something wrong, or is this something that can’t be done? I’m not really a coder so I’m at the mercy of the limits of this plugin right now ??
My code is as follows:
<div id="accordion_1"> [for each=category exclude=uncategorized empty=false] <h3>[each name]</h3> <div>[loop type=portfolio taxonomy=category relation=and taxonomy_2=status term_2=current] [field title] - [field services] <a href="">[field thumbnail]</a> [/loop]</div> [/for] </div>
- The topic ‘How can you hide empty categories when displaying posts within categories’ is closed to new replies.