how to add a menu item showing only posts matching TWO categories (logical AND)
-
I want to add need a menu item to the menu that filters posts for TWO categories (logical “AND”) simultaneously.
Here my challenge in more detail:
I organize an event that has “contributions”, each of which can fall in one or more of four “topics” (innvation, risk, change, and tools).
All of these “topics” are defined as WordPress categories and attributed to each post containing a “contribution”.If possible, I want to use the standard menu feature of wordpress to let visitors select all “contributions” regarding a specific “topic”.
Therefore I want “contributions” as the top menu item, and then suggest all four “topics” as sub items of this “contributions” menu item.
I should look like this (imagine a drop-down menu):contributions
innovation
change
risk
toolsI can set up a nested menu like that. But how do I combine BOTH filter criteria for the sub menu items, using the “Design/Menu” feature of wordpress? (Or by adding something to functions.php?)
Simply adding the “topics” in the sub menu will also display posts from other categories than the “contributions”, that also have the “topic” assigned (e.g. “speakers”…).
Thanks for your ideas!
PS: if possible, I would like to avoid using a plugin…
-
Hi there. To do this you’ll need to create a regular page rather than a category page and use the display posts shortcode to display your posts. The shortcode allows multiple taxonomy queries like you want to do, but it is limited to only displaying up to 100 posts. See here: http://en.support.wordpress.com/display-posts-shortcode/
- The topic ‘how to add a menu item showing only posts matching TWO categories (logical AND)’ is closed to new replies.