Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // If we're on the index page, we only want the two first posts.
- if ( is_home() && !is_paged() )
- query_posts('posts_per_page=2');
- // If we're within the index archives, we want ten posts per page as usual.
- else {
- // If we are past the second page, offset by an appropriate amount for the page.
- // I'm by no means a math guru; I don't know why this works. Trial & error rocks!
- if ( get_query_var('paged') != 2 )
- $offsetting = 2 + ( ( get_query_var('paged') - 2 ) * get_query_var('posts_per_page') );
- // If we're on the second page, offset by two.
- else
- $offsetting = 2;
- // Plug it into our query.
- query_posts($query_string . "&offset=$offsetting");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement