Advertisement
demetriusPop

search

Dec 8th, 2013
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.  
  5. Template Name: findyardsale-search
  6.  
  7. */
  8.  
  9. get_header();
  10.  
  11.  
  12. global $wpdb;
  13.  
  14. global $query_string;
  15.  
  16. $query_args = explode("&", $query_string);
  17. $search_query = array();
  18. $search_query = $wpdb->get_results('SELECT * FROM ' . $address_table . 'WHERE address = ' . $city);
  19.  
  20. foreach($query_args as $key => $string) {
  21. $query_split = explode("=", $string);
  22. $search_query[$query_split[0]] = urldecode($query_split[1]);
  23. } // foreach
  24.  
  25. $search = new WP_Query($search_query);
  26.  
  27.  
  28. ?>
  29. <div class="widget artwork-seachform search" rol="search">
  30.  
  31. <h3 class="widget-title">Search Artwork</h3>
  32.  
  33. <form role="search" action="<?php echo site_url('/'); ?>" method="get">
  34.  
  35. <input type="search" name="s" placeholder="Search: Enter artwork keywords hit enter"/>
  36.  
  37. <input type="hidden" name="<?php $query = $wpdb->get_results('SELECT * FROM ' . $address_table . 'WHERE address = ' . $city); ?>" value="artworks" />
  38.  
  39. <input type="submit" alt="Search" value="Search" />
  40.  
  41. </form>
  42.  
  43. </div><!-- .search -->
  44. <?php
  45. get_footer();
  46.  
  47. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement