[wp-trac] [WordPress Trac] #32409: paginate_links() shows 404 on custom post type archive
WordPress Trac
noreply at wordpress.org
Fri May 15 12:30:19 UTC 2015
#32409: paginate_links() shows 404 on custom post type archive
--------------------------+------------------------------
Reporter: Kuzmanov | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: trunk
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by boonebgorges):
I've spent some time trying to reproduce this, given the info you've
provided here. I'm able to reproduce some weird behavior, but I don't
think this is the fault of `paginate_links()`. I think the problem has
something to do with the way that you are overriding the `$wp_query`
global - it's likely that you're doing it after the main query has already
run (see `WP::main()` to get a sense of the load order).
To put the same point another way: When your posts_per_page is greater
than 5, `/page/3/` works. When posts_per_page is less than 5, the same
URL, `/page/3`, does not work. This has nothing to do with
`paginate_links()`.
Can you provide more complete details about exactly how you are
overloading the query? Does your first snippet (`$wp_query = ...`) appear
in a theme template file?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/32409#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list