Question: I have this code:

```
query_posts(array(
    'paged' => $paged,
    'post_status' => 'publish',
    'posts_per_page' => 6,
    'cat' => $term_id,
    'orderby' => 'date',
    'order' => 'DESC',
    'post_type' => 'post'
));

while (have_posts()) {
    the_post();
    ...
}

```

But I still get 10 posts not only 6. Also `get_query_var('posts_per_page', 1)` get me value 10 instead of 6. Why?

This is happening on the category.php page, on the homepage it is working correctly.

Answer: 
You are still using the default query. Use this instead:

```
    // The Query
    $the_query = new WP_Query( array(
    'paged' => $paged,
    'post_status' => 'publish',
    'posts_per_page' => 6,
    'cat' => $term_id,
    'orderby' => 'date',
    'order' => 'DESC',
    'post_type' => 'post'
    ));

// The Loop
if ( $the_query->have_posts() ) {

```
Try this 

```
$args = array ( 
      'paged' => $paged,
      'post_status' => 'publish',
      'posts_per_page' => 6,
      'cat' => $term_id,
      'orderby' => 'date',
      'order' => 'DESC',
      'post_type' => 'post'
    );
 $query = new WP_Query($args);
 if ( $query->have_posts() ) : 
   while ( $query->have_posts() ) : $query->the_post();
   /* Your Code */
   endwhile; 
 endif ;

```