No, it should start on page 1.
It could be because you’re using relative urls on form action.
Do you have a link to take a look?
Thread Starter
Alkorr
(@alkorr)
Hi David, thank you for your reply. Unfortunately my blog is offline for now but it was a problem I also encountered with my previous theme…
I have another problem (but surely related) when I’m on the 404 page (www.mywebsite.com/bookz/ instead of http://www.mywebsite.com/books/). When I do a search for Hemingway from this 404 error page, despite of showing all the results for Hemingway (there are plenty!) it returns ‘0 post found’ and the URL is http://www.mywebsite.com/bookz/?s=Hemingway instead of http://www.mywebsite.com/?s=Hemingway…
I know you’re kind of blind here but what do you think it could be? I searched on Google and the WP Forums and couldn’t find anything :\
In case it helps, here is my search box:
<form role="form" id="searchform" method="get" action="<?php home_url(); ?>">
<div class="input-group">
<input type="text" name="s" id="s" class="form-control" placeholder="Search..." >
<span class="input-group-addon">
<button type="submit">
<span class="glyphicon glyphicon-search"></span>
</button>
</span>
</div>
</form>
Thank you for your help! 🙂
Thread Starter
Alkorr
(@alkorr)
I replaced:
<?php home_url(); ?>
by:
<?php echo esc_url( home_url( '/' ) ); ?>
Now my Search from the 404 Page works fine, but the Search I used to make from the Books category (/books/) is now made from the whole website but I want it to still be only from the the Books category.
I think it should have something to do with getting the current_page_url() but it doesn’t work when I add this parameter :\
Any idea? I’m doing my best to find the solution by myself, I’m trying but a little help is always welcome! 🙂
Is books a custom post type?
What if you add this hidden input to your form:
<input type="hidden" name="post_type" value="books" />
Thread Starter
Alkorr
(@alkorr)
Hi David, nope, it’s not a Post Type per se, it’s a Category. And since the Search box is in my Archive.php page, the ‘value’ should be dynamic to search in the Books category when showing the Books archive posts, same for Movies, etc…
Thank you for you help 😉