bpr@brigittepellerinrobson.com
Member
Posted 4 weeks ago #
Hi, I'm having trouble with the native search engine. It works splendidly on the home page (www.drbarrydworkin.com; try searching for "vaccine" or "cancer") but if you go to any other page (www.drbarrydworkin.com/articles, www.drbarrydworkin.com/contact, www.drbarrydworkin.com/interviews-and-commentary) and try the exact same search from there, it doesn't work - gets you to a page that says "you're looking for something that isn't here".
I have no idea what's wrong. HELP please!
Basically, there is no value set for the action attribute on the search form. This problem appears to have been corrected in later releases of the theme - you are using 1.2.8 while the latest release is 1.3.2 - if you have not made any modifications to the theme, the easiest solution may be to upgrade to the latest version. If this is not possible, you will want to open header.php and look for code that looks similar to:
<div class="SearchBox">
<form method="get">
<input type="text" class="SearchQuery" id="SearchQuery" value="Search here..." name="s" />
<input type="submit" name="submit" class="SearchButton" value="Find" />
</form>
</div>
you then need to replace this bit:
<form method="get">
with:
<form method="get" action="<?php bloginfo('url') ?>/">
bpr@brigittepellerinrobson.com
Member
Posted 4 weeks ago #
Thank you SO MUCH! I made too many changes to the theme to re-upload, so I changed that line like you said and it's all working beautifully.
YAY!
illufoxdesign
Member
Posted 1 week ago #
I had problems too. My searches all went to the home page instead a search results page. So I looked at the code from a site where the search was working and found out that I had this missing:
name="s"
So I changed this:
<input type="text" value="<?php echo wp_specialchars($s, 1); ?>" id="s" size="15" />
to this:
<input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" size="15" />
And voila, the search is working!