How to solve pagination on query_posts()

You can easily solve this problem by adding a $paged function before query_posts() call in your index.php, category.php or any custom template that uses loops.

<?php
  $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  query_posts("cat=-9&paged=$paged");
?>

Advertisement

Did you like it?

No comments yet.

Leave a Comment