I have a problem with a custom WP_Query. I want a page with all posts with a specific tag. This is the code I'm using:
<?php //save old query $temp = $wp_query; //clear $wp_query; $wp_query= null; ?> <?php // The Query $wp_query = new WP_Query(); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'tag' => 'concurs', 'paged' => $paged ); $wp_query->query($args); ?> <?php // The Loop while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?> [some code that displays the title, excerpt, meta-info (author, category, date) and thumbnail] <?php endwhile; ?> <?php posts_nav_link(); ?> <?php //clear again $wp_query = null; //reset $wp_query = $temp; ?>
The problem is that when I switch to page 2 or 3 I get the same 10 first posts. What I am doing wrong?