Forums

Wondering if cross-category selection is possible with WordPress 3 ? (2 posts)

  1. sabinou
    Member
    Posted 1 year ago #

    Hello,

    I know this was impossible with wordpress 2.x, but maybe things have changed with wordpress 3.x, I'm asking just in case :)

    Would you know if there is now a way to sort posts by MORE THAN ONE categories, in other words with more complex rules than simply "belong to category A" or "belong to category B" or "belong to category C", etc... ?

    An example is better than a confused question :

    - Imagine a blog about literature, that has evolved over time and that has had categories added over time.

    - Imagine 6 categories : "modern lit", "XXth century lit", "classical lit", "poetry", "political essays", and "outstanding masterpieces".

    -> With wordpress 2.x, it was impossible to query the posts ONLY
    belonging to BOTH "classical literature" and "outstanding masterpieces". Or to query the posts ONLY belonging to BOTH "XXth century literature" and "poetry".

    - The same goes for tags and such, a cross-filtering was not possible.

    So, I was wondering, would you know if such an operation has become technically feasable, now that wordpress 3 is here ?

    I really strongly believe this would power up WordPress to a whole new level, because, at the present time, big proficient blogs are starting to become penalized by a too simplistic posts categorization system...

    Thank you VERY much if you can tell me if hope is now allowed :)

    Sabinou

  2. alchymyth
    The Sweeper
    Posted 1 year ago #

    imho, this works at least with categories and tags (and is not new to wp3):

    query_posts(array('category__and' => array(2,6)));
    http://codex.wordpress.org/Function_Reference/query_posts#Category_Parameters

    query_posts(array('tag__and' => array(37,47));
    http://codex.wordpress.org/Function_Reference/query_posts#Tag_Parameters

Topic Closed

This topic has been closed to new replies.

About this Topic