pagination errors for search with custom queries

I needed to add a one-off search form for the Home page. The form would search “Tour” Custom Post Types with a category or “vacations”.

I used a native WordPress Text widget and this code:

<form method="get" class="searchform" action="" role="search">
	<input type="text" class="field" name="s" value="" placeholder="Search">
	<input type="hidden" value="vacations" name="category_name" />
	<input type="hidden" value="tours" name="post_type" />

The search results worked, but the pagination was wrong: The pagination links doubled the search query, like this

I Googled the issue, but all I got were ways to effect all search results. I just want to fix the pagination for this one form.

I was under a deadline, so to fix this issue I removed the pagination from all searches.

Is there a way to fix this for my one-off form?

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.