WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Archive page not showing older (page 2+) posts (4 posts)

  1. fredhead
    Member
    Posted 5 years ago #

    Hi,

    I've copied an archive.php template, customized it to use query_posts to define the loop, created a new page and assigned it to my new template, and the new page displays fine the first set of 20 listings. However, when I click the next/prev links, I see only the same first page of content. I searched the forum and couldn't find anything on this.

    Any ideas how I can debug this? Thank you!

  2. fredhead
    Member
    Posted 5 years ago #

    Can anyone help me figure this out? Thank you!

  3. fredhead
    Member
    Posted 5 years ago #

    Hi,

    I really need help with this issue, if people know how archive pages and pagination in archive pages work. I've searched thoroughly through all the WP documentation and struck out. Surely this is a common problem for people setting up archive pages outside of the default archive.php structure?

    I'd appreciate help, if anyone can point me to resources. Thank you!

  4. fredhead
    Member
    Posted 5 years ago #

    In case someone finds this through search, here's the problem. The WordPress documentation says two different things with respect to category archive pages:

    1. Here it says you can use query_posts to restrict a category page to a specific category:

    http://codex.wordpress.org/Category_Templates

    2. Here it says use of query_posts will cause WordPress to ignore the page value, which condemns you to just a first page of listings:

    http://codex.wordpress.org/User:JamesVL/query_posts

    The documentation clearly needs to update at least the Category Template page to note that use of query_posts will cause WordPress to ignore the page value, thus preventing pagination links from working within a category page.

    I'm also amazed there don't appear to be any documentation pages about pagination, how it works, when it works. That would have saved me a few hours wasted time.

    In my case, I'm creating section home pages around specific categories. Since I can't use the category archive pages, I'll have to hack it by customizing versions of single.php, creating a blank (wasted) page for each section, assigning the new template to the page, and then in the new template manually including a link to the full category archive. Basically a ton of wasted time and needless complexity because WordPress doesn't read the page value when you use query_post.

Topic Closed

This topic has been closed to new replies.

About this Topic