• okey. it was hard to get brief on the topic.. XD

    The issue is that I want to show posts only if the two criterias is met. Now I got this:
    query_posts('cat=1,2');
    which means that it shows all posts in cat4 and cat5.
    If I got a post that is cat1 and cat3 it would display on that page.
    I only want to make a page that shows only posts that is in cat1 _and_ cat2. not only in cat1, not in cat1 and cat3, and so on.

    Is it some way to make a criteria like this one?
    I’m not any good in php ;O
    thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The category__and parameter of the
    template tag, query_posts(), should work for you.

    query_posts(array('category__and' => array(1,2)));

    I’ve got a related issue. I have two main categories “Videos” and “Podcasts” and a third category “Language” with a number of child categories that represent these topics (e.g., “English”, “Spanish”, “Italian”). What I’m trying to do is have a submenu under each of the two main categories, kind of like this (the number in parentheses is the number of posts available in that category):

    VIDEOS
    English (5)
    Spanish (2)
    Italian (5)

    and, separately

    PODCASTS
    English (17)
    Russian (3)

    I imagine you use something similar to the above, but with wp_list_categories. I’ve tried to configure this in various ways with no luck. I always get a list of all categories for which there is at least one post with a count of posts per category.

    Any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘query_posts – show post only if cat=1 _and_ cat=2’ is closed to new replies.