Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

Varying number of posts on homepage, archive pages

Prev Previous Post   Next Post Next
Old Dec 11, 2015, 11:06 PM
14 posts · Oct 2009
Varying number of posts on homepage, archive pages

I would like to have a different number of posts displaying on my homepage vs. my archive pages. For example, I only want one post to display on my homepage, but I would like 15 posts to display on category, tag, author pages, etc. This is the code I'm using, in the functions.php file, but it doesn't seem to work.

Any corrections, suggestions, improvements would be greatly appreciated. See the code below:

function number_of_posts_on_archive($query){
if ($query->is_archive) {
$query->set('posts_per_page', 15);
return $query;

add_filter('pre_get_posts', 'number_of_posts_on_archive');

BTW: my site is www.theimproper.com

Thanks in advance for your assistance.


Last edited by juggledad; Dec 12, 2015 at 04:16 AM.


archive pages, display posts, homepage

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to show all posts for the month in archive but only X number in home MacMcClellan Center area post/pages 2 Feb 17, 2013 06:49 AM
No excerpts but entire posts on 1st of my blog's pages archive bigliettaio Excerpts, Read more, Pagination 0 Jun 11, 2011 03:35 PM
[SOLVED] Different number of posts on home and post pages jasonchamb New Versions, & Updating 2 May 10, 2011 12:13 PM
[SOLVED] How can I get more posts to show up on archive/category pages? cowgrrrl Excerpts, Read more, Pagination 6 Jun 26, 2010 11:10 AM
number of excerpts on homepage luc Excerpts, Read more, Pagination 3 Mar 4, 2009 08:38 AM

All times are GMT -6. The time now is 04:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.