Search pagination rewrite to fix 404
The root of the problem is that you’re using s, the post query search parameter, but the code is for a user query. This means if your user query has 5 pages, but only 2 pages of posts are found, page 3 will 404. Instead, use a dedicated parameter with $_GET that isn’t a reserved … Read more