tags:

views:

40

answers:

1

hi, i'm tearing my hair out with this Wordpress problem. in a category section, i'm trying to display 5 posts on the first page and then the default number of posts (set to 6) on the 2nd and subsequent pages.

i've tried using query_posts('posts_per_page=5') on the first page but then the 2nd page displays posts 7 to 12 instead of posts 6 to 11 which is what i need. there is no continuity in the posts during the pagination between page 1 and page 2 when using posts_per_page.

i've come across a lot of articles on the web that seem to relate to this problem but can't find any solutions that work. please help if you can!

thanks!

A: 

It would be possible to achieve this by creating a custom archive page. You could check

get_query_var('paged');

then if the page is 1 use

query_posts('posts_per_page=5');

else use

query_posts('paged='.(get_query_var('paged')-1).'&offset=5');

This will cause the effects that when viewing the archive i.e. the posts after the first 5, the first 5 posts will be completely ignored so page 1 of the archive will start at post 6.

Mike
You could also achieve this with a template tag such as `is_home()` or something to that regard.
Chacha102
hey mike, thanks for your answer. i'll give that a try and let you know.
Andrew