I'm having trouble trying to create a second query on the category.php pages, what I'm trying to achieve is displaying the most popular posts from the current category archive page being viewed.
This is what I have so far.
<?php // The Query global $wp_query; $term = $wp_query->queried_object; $args=array( 'meta_key' => 'views', 'orderby' => 'meta_value_num', 'order' => 'DESC', 'posts_per_page' => 5, 'post_type' => 'post', 'tax_query' => array( array( 'taxonomy' => $term->taxonomy, 'field' => 'slug', 'terms' => $term->slug, ) ) ); $new_query = null; $new_query = new WP_Query($args); while ($new_query->have_posts()) : $new_query->the_post(); ?> <?php include(TEMPLATEPATH.'/category-slider.php'); ?> <?php endwhile; wp_reset_postdata(); ?>
Now for the most part it works but the only problem I'm having is that posts_per_page is only returning one post no matter what number I set.