WordPress.org

Make WordPress Core

Opened 7 months ago

Closed 7 months ago

#53476 closed defect (bug) (invalid)

Pagination not working correctly for certain URL taxonomy

Reported by: defpripub Owned by:
Milestone: Priority: normal
Severity: major Version:
Component: General Keywords:
Focuses: Cc:

Description

I have a Django/Python custom built CMS that I'm trying to migrate over to WordPress. Everything has been going smoothly except that pagination is broken for my blog. Here is the key information:

  1. I installed a WordPress droplet on Digital Ocean and then updated it to the latest release 5.7.2
  2. The url scheme of the blog on my old side follows the pattern site.com/blog/<slug>. E.g. site.com/blog/first-post, site.com/blog/php-tricks
  3. I migrated each post from my old site to the new WordPress installation as a "post", and put it under the category of blog
  4. In the WordPress admin, I went to "Settings > Permalink" and changed the URL taxonomy to be /%category%/%postname%, so that it would match my old site.
  5. When going to wp-site.com/blog I see the 5 most recent entries. At the bottom of the page, my template is using the function get_next_posts_link() to generate the pagination link, which is /blog/page/2. Which is what I expect.
  6. The oldest blog post is entitled "Pages Section Added", which has a slug of /blog/pages-section-added.

Here's where the issue is: When I click on the /blog/page/2 link, It's not sending me to see the next 5 most recent entries, It's doing a 303 (?) Redirect and sending my to /blog/pages-section-added. If I try something like /blog/page/8, it also sends me to that old blog post.

When I went back to Settings > Permalink, and changed the taxonomy to only be /%category%, pagination worked as expected when visiting /blog/page/2. But because of this, I can't access any single page blog posts.

I think this is a bug.

Change History (3)

#1 @dlh
7 months ago

Hi @defpripub, and welcome to WordPress Trac!

Does this behavior occur when no plugins are active and a default theme is enabled?

#2 @defpripub
7 months ago

I had no plugins enabled. I did have a custom theme that was built based off of Underscores. I don't think that the default theme uses get_next_posts_link(), but I could be wrong.

#3 @dlh
7 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
  • Version 5.7.2 deleted

Thanks @defpripub. Because a custom theme is involved, the best place to continue this discussion would probably be in the support forums, as support for individual themes or sites isn't available here in Trac.

This isn't to say that there isn't a core bug, only that Trac isn't the best place to investigate it without having steps to replicate the issue with a core theme. If those steps can be developed, please feel free to post those here and reopen this ticket.

Note: See TracTickets for help on using tickets.