Different post amounts shown per pagination page?
-
Hi Guys,
Is it possible to have 2 posts shown on the homepage (home.php) but then 10 posts shown on the next pagination page (www.example.com/page/2)?I’m using this in home.php currently:
<?php if (!is_paged()) { $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args=array( 'category_name'=>'topics', 'posts_per_page'=>2, 'paged'=>$paged, ); query_posts($args); } ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> // Do stuff <?php endwhile; ?> <?php endif; ?>
And it works great on the homepage, but when I go to /page/2 it only displays the next 2 posts, rather than the 10 set in Reading Settings. I can’t figure out how to have 2 on the homepage, and 10 on the pagination page.
Thanks for your help!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Different post amounts shown per pagination page?’ is closed to new replies.