View Single Post
  #1  
Old January 20th, 2015, 10:28 AM
yankeestonk yankeestonk is offline
 
Join Date: Jun 2013
Posts: 605
Default search bar searching by tag instead of title

http://saveongolf.net
saveongolfcopy is the store

I just realized my main search bar is searching by tag rather than title or description. I forgot how to change that. Somewhere in the redesign it must have been switched. A search for "Titleist" for instance grabs all sorts of results from companies that for some unknown reason put other manufacturer names in their tags.

This is the code I'm looking at for simple search

<script type="text/javascript">
<!--
/*
* NOTE: This JS code would be much better off
* existing in your theme's header.php file.
*/
function wash( anInput ) { if(anInput.value == anInput.defaultValue) anInput.value = ''; }
function checkWash( anInput ) { if(anInput.value == '') anInput.value = anInput.defaultValue; }
//-->
</script>

<div class="store_search_form">
[search.form]
[search.name onfocus='wash(this);' onblur='checkWash(this);' value='Refine search...']
[search.submit title='Go']
<input type="checkbox" name="saleprice" value="1-" />On Sale
[/search.form]
</div>


...and this is the code in the widget area of my wordpress site!

<form role="search" method="get" id="searchform" class="search-form" action="/store/search/">
<div><label class="screen-reader-text" for="s">Search for:</label>
<input class="search-field" type="text" name="word" id="s" value="<?php echo esc_attr( @$_GET['word'] ); ?>">
<input class="search-submit" type="submit" id="searchsubmit" value="Search"><input name="saleprice" value="1-" type="checkbox"><strong style="color:#fff;margin-top: 5px; display: inline-table; margin-left: 5px; float: left;">On sale</strong>
</div></form>


Thanks!
ken

Last edited by yankeestonk : January 20th, 2015 at 10:43 AM. Reason: adding code