Forums

Why only 10 posts? (1 post)

  1. pradyotghate
    Member
    Posted 4 months ago #

    In the code below, I am querying for 15 posts, I am only getting 10 posts (there are 12 posts in all in the category). Shouldn't I get all 12?

    <?php $args = array(
    'numberposts' => 15,
    'cat' => 13,
    'orderby' => 'post_date',
    'order' => 'DESC',
    'post_type' => 'post',
    'post_status' => 'publish' );
    ?>

    <?php $the_query = new WP_Query( $args ); ?> <!--gets all posts from category 12 -->

    <div class="roll">
    <?php while ( $the_query->have_posts() ) : $the_query->the_post();
    echo '<span class="thumb"><a href="';
    the_permalink();
    echo '">';
    the_post_thumbnail('small');
    echo '
    </span>';
    endwhile; ?>
    </div>

Reply

You must log in to post.

About this Topic