[Plugin: List category posts] support for boolean-and?
-
When passing a list of category IDs to the plugin, it uses the boolean-or query, so posts in any of the categories get returned – but this plugin gets even more useful when modified to support boolean-and, so that only posts in all of the listed categories are returned.
I’ve hacked this into my copy of the plugin, but am not sure how to implement it properly (so that it doesn’t break expected behaviour for people relying on the existing boolean-or functionality).
The boolean-and query is baked into WordPress now, but the query needs to be modified to support it.
Here’s the modifed query I use, in
list_category_posts()
:$catposts = get_posts(array( 'category__and'=>explode(",", $atts['id']), 'posts_per_page'=>$atts['numberposts'], 'orderby'=>$atts['orderby'], 'order'=>$atts['order'], ));
Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
- The topic ‘[Plugin: List category posts] support for boolean-and?’ is closed to new replies.