WordPress.org

Ready to get started?Download WordPress

Forums

getting posts from two categories (1 post)

  1. maxelcat
    Member
    Posted 2 years ago #

    Hi

    I have a small blog. I want to show posts from categories that have the numbers 10 and 15 - and order them by date

    I have tried this:

    <?php
       if (is_home()) {
    query_posts( array ( 'category_and' => array(10,15), 'posts_per_page' => 20, 'orderby'=>'date', 'order'=>'DESC' ) );
    }
    ?>

    but it doesn't work - it gives me 20 posts, but not restriced to the two categories

    Please can someone help.

Topic Closed

This topic has been closed to new replies.

About this Topic