I'm trying to limit the number of posts that show on a category page. I was doing this with query_posts, like this
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
if (have_posts()){
query_posts('posts_per_page=6&paged=' . $paged);
The problem is that the query_posts seems to keep the site from realizing what category page it's on, so it shows posts from all categories. Is there a way to fix this? It seems like there should be a way to force WordPress to "get the category" after the query_posts so that it realizes what category it's on and will then display only the relevant posts?
------ Editing to show code when using WP_query ----
echo '<h4>Latest Resources</h4>'."\n";
global $post;
if (have_posts()){
$paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
$the_query = new WP_Query( array(
'post_type' => 'post',
'paged' => $paged,
'posts_per_page' => 6));
while($the_query->have_posts()) {
$the_query->the_post();
if($post->post_type == 'page') continue;
setup_postdata($post);
$categories = get_the_category();
echo '<div class="listing">';