Posts_per_page work not correct
-
I have 2 category (parent and child) with one template for both. I want to use query_posts for pagination. I’m use posts_per_page for limit posts on page. All work’s fine except one things – I cant see child category without parent. If I dont use query_posts all works fine but I cant limit posts on page.
My code before loop.
<?php $limit = 6; $catid = 4,6; $catid = strpos( $catid , ',' ) ? explode( ',' , $catid ) : array( (int) $catid ); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts(array('category__in'=>$catid,'posts_per_page'=>$limit,'paged'=>$paged)); $wp_query->is_archive = true; $wp_query->is_home = false; ?>Please help me understand!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Posts_per_page work not correct’ is closed to new replies.