Categories

Featured templates

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

Carey Burns January 29, 2016
Rating: 5.0/5. From 2 votes.
Please wait...
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)
This entry was posted in Monstroid Tutorials, WordPress Tutorials and tagged custom, Monstroid, number, post, type. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket