Pagination with query_posts not working
-
Hi all, i’m builing up a page where want to show only posts with custom field ‘spot’ filled in, from all available categories and show below this post all other posts as links from the same category. I’m using the ‘spot’ marked post as a information post about the category and with the related code I show all other posts in the same category as link. This all works fine, below the code I use:
[code moderated - please follow the forum guidelines for posting code]
The problem starts when I want to put pagination into it. When I add
'posts_per_page' => 2to the query the whole pagination screws up, because the related posts are also counted as a post and that's not the intention. Is there a way to show the related posts, but outside the main query? And have 2 'spot' marked posts with all releated posts per page?Below what I want
PAGE 1
SPOT POST in Category 1
RELATED POST in Category 1
RELATED POST in Category 1SPOT POST in Category 2
RELATED POST in Category 2
RELATED POST in Category 2
RELATED POST in Category 2
RELATED POST in Category 2
RELATED POST in Category 2
RELATED POST in Category 2PAGE 2
SPOT POST in Category 3
RELATED POST in Category 3
RELATED POST in Category 3
RELATED POST in Category 3
RELATED POST in Category 3SPOT POST in Category 4
RELATED POST in Category 4
RELATED POST in Category 4ETC.
Hope someone can put me in the right direction, thanks!
The topic ‘Pagination with query_posts not working’ is closed to new replies.