Is there a parameter I can set to dynamically limit or increase the amount of posts per page

Let’s say I have a WordPress blog that by default shows 10 posts per page but sometimes I’d like to show 50 posts per page. Is there a parameter in the URL that I can add to increase that limit to 50?

Update
This appears to work and is used in header.php:

// Support posts per page - Note: needs review
if (isset($_REQUEST['posts_per_page'])) {
    $pageCount = $_REQUEST['posts_per_page'];
    $wp_query->set("posts_per_page", $pageCount);
    $wp_query->get_posts();
}

Related posts

Leave a Reply

1 comment