How to Remove the Posts Per Page Limit in WordPress
By default, the WordPress blogging software includes a limit on the number of posts that appear per page. While this is convenient for those who want a blog that divides its pages according to a set number of posts, individuals who wish to create a single-page website using the blog format need to disable this setting. Fortunately for those users, the posts-per-page limit can be removed by changing one line of code in the WordPress control panel.
Instructions
-
-
1
Log in to your WordPress blog's administrator control panel. Click the "Editor" option in the Appearance category on the left side of the control panel to access the WordPress theme editor.
-
2
Search the Templates listing on the right side of the screen and locate the entry labeled "Archives." Click it to access the code for the file named "archive.php."
-
-
3
Locate the line that contains "<?php get_header(); ?>" in the archive file's code; it should be the second line of the file.
-
4
Replace the line you located with "<?php get_header(); query_posts( 'posts_per_page=-1&cat=' . $cat ) ?>" without the quotation marks. Click the "Update File" button once the replacement has been made to save it.
-
5
Repeat this process for the "category.php" file. If a file with that name does not exist, use your website's control panel software or an FTP program to make a copy of the file named "index.php" and rename it to "category.php" to make the changes.
-
1
Tips & Warnings
The removal of posts-per-page limits can be reversed by restoring the changed lines to "<?php get_header(); ?>" without the quotation marks.