I am adding to a theme, one page of the theme needs a custom search.
The site contains some property listings, the pages are created in a hierarchy i.e.
for sale page
area page (child of for sale)
property name page (child of area)
so the urls are
http://www.site.com/for-sale/Staffordshire/Bob-Drive/
there are several categories i.e. for sale, for rent, part buy etc each containing several areas and properties within each area.
What I need to do is create a filterable search page, I am going to use jquery to provide the filtering so all I need to do with wordpress is to bring out all of the results and display these on the page. The filter is going to occur on the class name when output i.e. class='forsale staffordshire'. That would then show up on a filter for those criterea
I hae gathered that I need to use wpdb to gather my results, but how do I gather them, then output to the page?
So far I have
<?php
$searchresults = $wpdb->get_results( "SELECT * FROM wp_posts" );
?>
to start the query off, I need to write this to the page as
<li class="propertytype area">
<a href="link to property">Property name <img src="featuredimage"></a>
</li>
loop through etc
Can someone lend a hand please?
Many thanks