0
votes

I am using a permalink structure like this:/%category%/%postname%. That's all fine when I go to /category or /category/blogpost. but, the problem is when I enable pagination on the /category post list. Because of the permalink structure, I get things like /category/page/2 for the page links. When I go to them, I get a 404 — presumably because it's trying to find a blog post with the slug 'page'. I can get it to work if I manually go to /category?paged=2.

So, either i need to get the default format of the pagination links to use query strings, or I need to get the permalink structure working. My problem is that I am using a theme that calls into its own library to build post lists, so I can't modify how it generates the pagination. Maybe there's an action or filter I could hook into?

I have tried hooking into pre_get_posts and setting the 'paged' and 'cat' properties of the query based on the URI but to no avail. Any ideas?

1

1 Answers

0
votes

I found a fix for this. The categories I am using map directly to a custom post type. I messed around with the settings of the post type in the plugin I am using (CPT UI) and set the 'Has Archive' property to true. This fixed it (using the pretty permalink structure).