Results 1 to 2 of 2

Thread: Custom Search

  1. #1
    Thread Starter
    Amateur findlorenz's Avatar
    Join Date
    Apr 2011
    Posts
    19
    Thanks
    0
    Thanked 1 Time in 1 Post

    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.

  2. #2
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    41,006
    Thanks
    170
    Thanked 3,409 Times in 3,280 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Custom search bar
    By nickmclennan in forum ClassiPress General Discussion
    Replies: 10
    Last Post: April 9th, 2013, 02:50 PM
  2. Using search plugin WP Custom Field Search
    By Unregistered in forum ClassiPress General Discussion
    Replies: 70
    Last Post: August 31st, 2011, 11:01 PM
  3. [TUTORIAL] WP Custom Search messing up Google Adsense on search pages
    By mlanghorst in forum ClassiPress General Discussion
    Replies: 1
    Last Post: August 8th, 2010, 08:38 PM
  4. custom book search?
    By tmcguire in forum Help Using ClassiPress
    Replies: 0
    Last Post: June 20th, 2010, 09:49 PM