No Limit To Posts Per Page

This code enables you to display all posts on the one archive page rather then limit how many are displayed.

You can modify the conditional tag to control your home page, archive pages or custom post type archives.

You can use nopaging set to true:

$query->set( 'nopaging', 'true' );

Or posts per page set to -1.

$query->set( 'posts_per_page', '-1' );

Please copy ALL the code from the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.