Custom Search
Hi - I have setup a custom search bar in my word press as you can see by attachement.
This is the code that was created...
<div class="searchblock">
<script language="javascript" src="<?php
$url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
$url = substr($url, 0, strlen($url)-1);
$pathdepth = substr_count($url, "/") - 2;
for($i=0;$i<$pathdepth;$i++)
{
echo "../";
}
?>citychange.
js"></script>
<form action="<?php bloginfo('url'); ?>" method="get" id="searchform" class="form_search">
<button class="btn-topsearch" type="submit" tabindex="4" title="Search Ads" id="go" value="search" name="s"><?php _e('Search Ads','appthemes'); ?></button>
<?php wp_dropdown_categories('show_option_all='.__('All Categories', 'appthemes').'&hierarchical='.get_option('cp_cat_h ierarchy').'&hide_empty='.get_option('cp_cat_hide_ empty').'&depth='.get_option('cp_search_depth').'& show_count='.get_option('cp_cat_child_count').'&or derby='.get_option('cp_cat_orderby').'&title_li=&u se_desc_for_title=1&tab_index=3&class=searchbar&ta xonomy=ad_cat'); ?>
<select id="search-prov" tabindex="1" class='searchbar' onchange="CityChange(this, <?php echo $pathdepth; ?>);">
<option value='' selected='selected'>Provinces</option>
<option class="level-0" value="Alberta">Alberta</option>
<option class="level-0" value="British Columbia">British Columbia</option>
<option class="level-0" value="Manitoba">Manitoba</option>
<option class="level-0" value="New Brunswick">New Brunswick</option>
<option class="level-0" value="Newfoundland">Newfoundland</option>
<option class="level-0" value="Nova Scotia">Nova Scotia</option>
<option class="level-0" value="Ontario">Ontario</option>
<option class="level-0" value="Prince Edward Island">Prince Edward Island</option>
<option class="level-0" value="Territories">Territories</option>
<option class="level-0" value="Québec">Québec</option>
</select>
<select id="search-city" tabindex="2" class='searchbar'>
<option value='' selected='selected'>Cities</option>
</select>
</form>
</div> <!-- /searchblock -->
I have a .
js file and .xml that goes in the base public_html folder and added this code for my css to settings under Appearance...
Where it has....
form_search select#cat.searchbar{float:right; border:1px solid #BBB;
min-height:15px; min-width:250px;
padding:7px;font-size:17px;color:#666666;-khtml-border-radius: 6px;
-moz-border-radius:6px; -webkit-border-radius: 6px; border-radius:
6px; line-height: 33px;}
select#cat.searchbar option.level-0 {padding:0px; font-weight:normal;}
Add these 4 lines right before...
.form_search select#search-prov.searchbar{float:left; border:1px solid
#BBB; min-height:15px; min-width:250px;
padding:7px;font-size:17px;color:#666666;-khtml-border-radius: 6px;
-moz-border-radius:6px; -webkit-border-radius: 6px; border-radius:
6px; line-height: 33px;}
select#search-prov.searchbar option.level-0 {padding:0px; font-weight:normal;}
.form_search select#search-city.searchbar{position:relative;
left:29px; float:left; border:1px solid #BBB; min-height:15px;
min-width:250px;
padding:7px;font-size:17px;color:#666666;-khtml-border-radius: 6px;
-moz-border-radius:6px; -webkit-border-radius: 6px; border-radius:
6px; line-height: 33px;}
select#search-city.searchbar option.level-0 {padding:0px; font-weight:normal;}
Although when I do search now I get nothing, what would the search parameters be to complete search function for it to work correclty. I keep getting listing not found. And it's quiet frustrating.
Any help would be great. Thanks.