Home / Blog / Query_posts() with WP-PageNavi

Query_posts() with WP-PageNavi

December 18th, 2010 by | 3 Comments

For WordPress theme designers who use WP-PageNavi plugin and query_posts() together, it is likely that the page numbers do not show posts correctly. All pages display the same posts no matter which page you are on. Here is how to use query_posts() correctly with WP-PageNavi:

Open the file with the query_posts() function, index.php for example.

Find:

query_posts('category_name=resources');

Replace with:

query_posts('category_name=resources'.'&paged='.get_query_var('paged'));

Learn how to use query_posts().

Tags: ,

Categories: Blog, Wordpress |

3 Responses to “Query_posts() with WP-PageNavi”

  1. oneTarek says:

    This Site http://zced.com is using query_post() to exclude all posts in a specific tag from home page

  2. Miles says:

    Thanks… Great help.. Was racking my brains as it was sticking on page 1 posts even though i was clicking 3 & 4

  3. Rimvydas says:

    Super! It is exactly the thing what i was looking for. Thank you very much!

Leave a Reply