Search pagination rewrite to fix 404


I’m wondering if anyone can help me out here?

Basically, I think I need to use add_rewrite_rule() to get pagination working in my search results, as I’ve gone beyond the default query due to a bunch of extra stuff that needs to happen when fetching results (querying posts and users, in this case).

The first page of my search results works fine.

Example: /?s=lighting&post_type=service.

However, when I go to the second page of results, I get a 404.

Example: /?s=lighting&post_type=service&paged=2.

Any help would be greatly appreciated!

Jase Warner 1 month 2023-04-25T03:47:33-05:00 0 Answers 0 views 0

Leave an answer