Welcome IP: 72.21.34.82

Removing the limit of posts per page

Send this article to a friend Send this article to a friend

Removing the WordPress post per page limit: By default, WordPress posts are limited based on the posts_per_page setting. Making many of your older posts incredibly hard to find for both search engines and readers. Like many readers, I hate (pagination) having to read through pages of posts in a category one page at a time. So I decided to find a way to make every post within any given category show up on a single category page eliminating the need to flip through pages. In the following tutorial, I'll explain how this is accomplished.

How to remove the WordPress post per page limit:

  1. Login to your WordPress administration panel
  2. Navigate to Design -> Theme Editor and select either category.php or archive.php from the list. If neither exist, use an ftp program and copy your index.php file to category.php
  3. Find the following line:
  4. PHP:
    1. <?php get_header(); ?>

  5. And change it to look like this:
  6. PHP:
    1. <?php get_header(); query_posts( 'posts_per_page=-1&cat=' . $cat ) ?>

  7. Click update file and go view your site

                            

If you find this information useful, feel free to express your support via a quick PayPal Donation: