WordPress.org

Ready to get started?Download WordPress

Forums

Pagination for Custom Loop in a 'Page' Giving 404 Error (1 post)

  1. EFAREM
    Member
    Posted 3 years ago #

    I have a page for news, permalink /news/ I am using a template page-news.php, within this template I'm using a custom loop to retrieve all posts with a post_type of news. Here are my query_posts args.

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>

    <?php query_posts(array('post_type' => 'news', 'posts_per_page' => '2', 'is_paged' => true, 'paged' => $paged )); ?>

    This works fine, I get two posts along with the 'Old Posts' link, however when I click the link it sends me to /news/page/2/ which returns a 404 error.

    Any ideas how I can fix this?

Topic Closed

This topic has been closed to new replies.

About this Topic