Return to Snippet

Revision: 46368
at May 18, 2011 01:01 by rickfu


Initial Code
<?php if (have_posts()) : ?>
     <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("category_name=somecat&paged=$paged"); ?>
        <?php while (have_posts()) : the_post(); ?>

Initial URL
http://stylizedweb.com/2008/08/13/query_posts-pagination-problem/

Initial Description
Replace standard query_posts with the snippet to enable pagination on pages with a custom loop. Be sure to change out "somecat" with your category or add additional query arguments.

Initial Title
query_posts() Pagination problem | StylizedWeb.com

Initial Tags
php, wordpress

Initial Language
PHP