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.
Keith