• Hi,
    whats the best way to get a list of posts based on 2 categories.

    “show posts which are in categoryA AND categoryB”

    thanks

    pete

Viewing 1 replies (of 1 total)
  • Have you tried the query_posts() function? If not, you just add it before your WordPress Loop and it allows you to specify what the loop returns. In your situation, the following would work. You just need to change the numbers to the id’s of the categories that you wish displayed:

    <?php query_posts( 'cat=2,6' ); ?>

Viewing 1 replies (of 1 total)

The topic ‘get posts based on 2 categories’ is closed to new replies.