If this tutorial is not what you were looking for, you still have any questions, suggestions or concerns - feel free to let us know. Please help us to serve you better!

Your Name

Your Email

Your Message (required)

captcha

Featured templates

Monstroid. How to change number of posts on custom post type pages (team, testimonials)

Monstroid. How to change the number of posts on custom post type pages (team, testimonials)

Our Support team is ready to present you a new tutorial that shows how to change the number of posts on custom post type pages (team, testimonials) in Monstroid templates.

monstroid_number_of_posts_per_page_1

  1. You will need to edit the Theme Functions file – functions.php:

    monstroid_number_of_posts_per_page_2

  2. Add the following action code to the file:

    	 add_action( 'pre_get_posts', 'add_teamlimit' );
    
    function add_teamlimit( $query ) {
    
      if ( is_page(X) ){
           $query->set( 'posts_per_page', -1 );
      }
    
      return $query;
    }
    	 

    where X is your page id and -1 can be changed to any number:

    monstroid_number_of_posts_per_page_3

  3. Save changes to file when you are done.

  4. Check the result on your website:

    monstroid_number_of_posts_per_page_4

Feel free to check the detailed video tutorial below:

Monstroid. How to change the number of posts on custom post type pages (team, testimonials)