WordPress.org

Ready to get started?Download WordPress

Forums

Previous Posts link only half working (2 posts)

  1. web93
    Member
    Posted 1 year ago #

    Having a weird problem on a site where the 'previous posts' at the bottom of a category template is only working on first click.
    i.e. domain.com/news - click 'previous posts' - loads the next 20 posts on domain.com/news/page/2

    However once on /page/2, when I click 'previous posts' again it loads /page/3 but just says 'Sorry, no posts matched your criteria.' There are definitely more posts as extending the query to display unlimited posts reveals them.

    This is whats being used:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    
    query_posts('order=DESC&orderby=date&category_name=news, film-projects, our-projects&posts_per_page=20&paged='.$paged);

    and at the bottom of the page:

    <?php next_posts_link('&laquo; Previous Entries') ?>
    
    <?php previous_posts_link('Next Entries &raquo;') ?>

    Any ideas?

  2. vtxyzzy
    Member
    Posted 1 year ago #

    Not sure if this is the cause, but it looks odd to me that there are spaces in the query string between category slugs. Try removing the spaces.

Topic Closed

This topic has been closed to new replies.

About this Topic