Change the Posts Per Page in Your Portfolio Category Template

Share this on:

If you created a category template for your design portfolio using the Genesis Modern Portfolio Theme, like my daughter did, you may want to change the number of posts per page.

category design portfolio page
All images from unsplash.com

Change Archive Posts Per Page in WordPress Settings

The easiest method to change the number of posts is to change it in the WordPress Settings.

From your WordPress Dashboard:

  • Click on Settings > Reading.
  • Change the “Blog pages show at most” to the number of design posts you want on your design category archive page.

Since your design posts are in 3 columns, you probably want to choose a multiple of 3. We chose 12 posts. You can leave all other settings on that page as they are.

archive posts per page

Note that if you’re using Genesis, changing this WordPress Setting changes the number of posts for all your archive pages – all your category and tag pages. It does not change the number of posts on your blog page, since your blog uses the Genesis Blog Template.

Change Blog Posts Per Page in Genesis Theme Settings

To change the number of posts on your blog page in Genesis:

  • In your WordPress menu, click Genesis > Theme Settings.
  • Find the Blog Page Template section.
  • Change the “Number of Posts to Show” to be what you want for your blog.
genesis blog posts per page

Change Posts Per Page Only for Your Category Archive

You can also change the number of posts for only your design category archive by adding a function to your child theme functions.php. This was added to the GitHub Gist to so all the code is in one place.

Open your functions.php in a text editor and add:

// Change posts per page in the design category
add_action( 'pre_get_posts', 'mp_design_cat_posts_per_page' );
function mp_design_cat_posts_per_page( $query ) {
	if( $query->is_main_query() && is_category( 'design' ) && ! is_admin() ) {
		$query->set( 'posts_per_page', '12' );
	}
}

(This function is based on Customizing the WordPress Query from Bill Erickson.)

You will need to make two changes to this code before using it:
First change the category slug.

  • Since our category slug is “design”, we used is_category( 'design' )
  • You want to change it to use your slug.
  • If your slug is “design-portfolio”, you would use is_category( 'design-portfolio' )

You also want to change the ( 'posts_per_page', '12' ).

  • Change the number 12 to be the number of posts you want on each of your design category archive pages.

This was added to the GitHub Gist to so all the code is in one place.

Now you can have a custom number of posts per page for only your design category archive.

You can have a beautiful, hardworking website for your small business.

Tell me about your website project for a personalized solution!


Do you need website tips?

Sign up to get easy-to-use WordPress tutorials, Genesis theme customizations, and other helpful tips for your small business website.

Your email address will be used to send you blog posts. Privacy Policy


photo of Marcy Diaz who owns Amethyst Website Design

Comments

6 responses to “Change the Posts Per Page in Your Portfolio Category Template”

  1. Magnus Hjerpe Avatar
    Magnus Hjerpe

    Hi Marcy,

    Many thanks for your post with the explanation of how to change the number of blog posts per page with the Genesis theme. I was frustrated when I could not change it through the usual settings in WordPress, but with your help it worked!

    1. Marcy Diaz Avatar

      I’m glad it helped you, Magnus!

  2. Marcy Diaz Avatar

    You’re welcome, Gaurav! Glad to help.

  3. Alberto Rendon Avatar

    I have my problem of reducing the number of posts on my homepage, I did everything but of no avail. I don’t how and where I can find a solution.

    1. Marcy Diaz Avatar

      This post only applies to the Modern Portfolio theme.

      If your home page is a blog page, you can try to change the number under Genesis > Settings > Blog Page Template

  4. dawn Avatar

    Thank you! I was looking through all my theme setting trying to figure out how to increase the number of posts showing on a category page. This worked great!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.