Site logo

Archived topic

How to increase post snippets on a category page?

3 replies · Started by Norman on October 15, 2019

Viewing posts 1–4 of 4

Where do I select how many post snippets to display on a category page? Right now, there are 8, but I want to increase that.

Hi there,

you set the number of posts to display in Dashboard > Settings > Reading.

If you want to change just the archives and not the main blog page then it requires PHP like so:

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');

Thanks David!

I should have known the settings, but since I hadn't changed it in a long time, it wasn't so obvious.

You're welcome

This archived topic is closed to new replies.