I'm trying to build a custom search form and I'd like to override the site's default posts per page limit but the hidden field I'm using doesn't seem to want to work at all:
I have:
<input type="hidden" value="-1" name="posts_per_page" />
..but this seems to be ignored when I'm inspecting $wp_query on the search results page (the search I'm doing matches 29 posts, but a count on $wp_query->posts comes in at 10. I've done multiple tests using different values to no avail.
The full custom search form looks like this:
<form role="search" method="get" id="search" action="/" class="col-xs-12">
<input type="text" value="" name="s" id="s" />
<input type="hidden" value="1" name="sentence" />
<input type="hidden" value="-1" name="posts_per_page" />
<input type="hidden" value="any" name="post_type" />
<input type="submit" id="searchsubmit" value="Search" />
</form>
Is there something pretty basic I'm overlooking?
I had a bunch of pre_get_posts actions set up for tweaking stuff in the admin screens, but I've disabled all of these to see if they were interfering but again, no joy.