Custom Post Type Pagination Doesn’t Work in WordPress 3.4

I have a problem when using WordPress 3.4. My “Products” custom post type pagination doesn’t work. Here is the code I use

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$loop = new WP_Query( array(
'post_type' => 'products',
'posts_per_page' => PER_PAGE_DEFAULT,
'paged'=>$paged
) );

That code works well in previous WP version (WordPress 3.3.2) but not in current version i.e. 3.4. What am I doing wrong?

1 Answer
1

Use get_query_var('page') instead of get_query_var('paged'). Related ticket: #21028

Leave a Comment