If your template uses query_posts, you must set the ‘paged’ variable in your query. See this reference:
http://codex.wordpress.org/Function_Reference/query_posts#Pagination
ah ok thanks for that, so i would just implement this code (removing the need for category and order by) before the loop begins in loop.php ?
query_posts( array( ‘category__and’ => array(1,3), ‘posts_per_page’ => 2, ‘orderby’ => ‘title’, ‘order’ => ‘DESC’ ) );
You must use ‘paged’ in addition to any other parameters your query needs.
So, if you are currently using the query_posts code that you posted, you would need to set a $paged variable and add it to the query like this:
$paged = (get_query_var('page')) ? get_query_var('page') : 1;
query_posts( array( 'category__and' => array(1,3), 'posts_per_page' => 2, 'orderby' => 'title', 'order' => 'DESC', 'paged' => $paged ) );
thanks for your reply, gonna try this out tomorrow
Ive installed the plugin WP PageNavi…. but not sure what to do next …
this is the if statement that starts at the beginning of loop.php, just wondering if anything is wrong with this…
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<div id=”nav-above” class=”navigation”>
<div class=”nav-previous”><?php next_posts_link( __( ‘<span class=”meta-nav”>←</span> Older posts’, ‘twentyten’ ) ); ?></div>
<div class=”nav-next”><?php previous_posts_link( __( ‘Newer posts <span class=”meta-nav”>→</span>’, ‘twentyten’ ) ); ?></div>
</div><!– #nav-above –>
<?php endif; ?>
More than likely, the problem is with the query_posts() statement. Post a few lines of code (around 10) that show the query_posts() call at the end.
is this the query posts statement ?
‘
<?php /* Display navigation to next/previous pages when applicable */ ?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<div id=”nav-below” class=”navigation”>
<?php wp_pagenavi(); ?>
</div><!– #nav-below –>
<?php endif; ?>
‘
No, it will say ‘query_posts()’ with other things inside the parentheses.
ah i see, this function doesnt exist in my ‘loop.php’ file :S