WordPress.org

Ready to get started?Download WordPress

Forums

home.php and custom pagination (1 post)

  1. smerriman
    Member
    Posted 6 years ago #

    I'm coding a website and am having a problem with 2.5.1 and pagination on the homepage. I've used many custom queries in my time but haven't come across this problem, so I'm not sure whether it is 2.5 specific or not.

    On my homepage I display the latest post (just 1) from a certain category with :

    $paged = get_query_var('paged'); if (!$paged) $paged=1;
    query_posts('cat=1&showposts=1&posts_per_page=1&paged='.$paged);

    (I want to leave the general settings as more than 1 post per page for archives, search results etc).

    The problem is, I currently only have a few posts on the site - so when I load /page/2/ and WordPress is deciding what template to use, it thinks there shouldn't be a page 2, and loads the 404 template instead of home.php.

    Is there any way to get around this so I can get pagination working properly?

Topic Closed

This topic has been closed to new replies.

About this Topic