php - Search results form to show another page -
i using vebra plugin on wordpress, use shortcodes show search area , shortcode show results.
i have homepage (http://lytham.voodoodev4.co.uk/) using "search" shortcode, "properties" shortcode on http://lytham.voodoodev4.co.uk/?page_id=33
when search on page refreshes page, how push search results page?
search php:
<div id="propertyfilter" class="vp_search"> <form action="<?php echo vp_get_search_link()?>" method="get"> <?php vp_hidden_fields(); ?> <div class="property_refine">refine search:</div> <div class="property_type"> <?php vp_get_areas(); ?> </div> <div class="property_search_group"> <p>minimum number of bedrooms</p> <?php vp_get_bedrooms(); ?> </div> <div class="property_search_group vp_price"> <p>minimum price of property</p> <?php vp_get_minprice(); ?> </div> <div class="property_search_group vp_price"> <p>maximum price of property</p> <?php vp_get_maxprice(); ?> </div> <div class="property_search_group vp_rent"> <p>minimum rent property</p> <?php vp_get_minrent(); ?> </div> <div class="property_search_group vp_rent"> <p>maximum rent property</p> <?php vp_get_maxrent(); ?> </div> <div class="property_search_group vp_commercial"> <p>min area (sqft)</p> <?php vp_get_minarea(); ?> </div> <div class="property_search_group vp_commercial"> <p>max area (sqft)</p> <?php vp_get_maxarea(); ?> </div> <div class="property_search_group"> <p>type of property</p> <?php vp_get_property_types(); ?> </div> <div class="property_search_group"> <p>location</p> <input type="text" id="vp_location" name="vp_location" placeholder="enter postcode or place name" value="<?php vp_get_location(); ?>" /> </div> <div class="property_search_group"> <p>search</p> <?php vp_get_radius(); ?> </div> <input class="submit" type="submit" value="search" /> </form> </div>
properties results php:
<div id="propertyresults"> <?php echo vp_list_head(); if ($properties=vp_theproperties()) { switch (vp_get_view()) { case "list": ?> <div id="propertylistview"> <div id="propertyordering" class="clearfix"> <div id="orderby"> <span id="vp_order_message">order by:</span> <?php vp_get_orderby(); ?> <a href="#" id="viewmap" class="button">view map</a> </div> </div> <div class="clearfix"> <?php foreach ($properties $property) { ?> <div class="property"> <div class="left_column"> <div class="property_image"> <a class="property_overview_thumb" href="<?php echo vp_propertyurl($property->vebraid); ?>" title="<?php echo $property->address_custom; ?>"> <?php echo vp_propertyimage($property->vebraid,0,"property_image"); ?> </a> <div class="property_tagline"><?php echo $property->web_status; ?></div> </div> </div> <div class="right_column"> <div class="property_summary"> <h3 class="property_title"> <a href="<?php echo vp_propertyurl($property->vebraid); ?>"><span><?php echo $property->address_custom; ?> <?php echo $property->property_type; ?></span></a> </h3> <h4 class="property_address"><?php echo $property->address_display; ?></h4> <div class="property_excerpt"><?php echo $property->excerpt; ?></div> </div> </div> <div class="property_features clearfix"> <?php if ($property->area == "commercial") { if (!empty($property->propertyarea_sqft)) {?> <span class="property_area"><?php echo $property->propertyarea_sqft; ?> sqft</span> <?php } ?> <?php } else {?> <span class="property_beds"><?php echo $property->bedrooms; ?> bedrooms</span> <span class="property_baths"><?php echo $property->bathrooms; ?> bathrooms</span> <?php } ?> <div class="property_price">£<?php echo number_format($property->price,0,"",","); ?> <?php echo $property->price_postfix; ?><a href="<?php echo vp_propertyurl($property->vebraid); ?>" class="button property_button">view details</a><?php do_action('vp_other_action_buttons',$property->vebraid,'button property_button') ?></div> </div> </div> <?php } ?> </div> <div class="properties-paging"> <ul> <?php if (vp_current_page() > 1) { ?> <li><a href="#" data-id="<?php echo vp_current_page()-1; ?>" class="properties-page">< previous</a></li> <?php } ?> <li>page <?php echo vp_current_page(); ?> of <?php echo vp_page_count(); ?></li> <?php if (vp_current_page() < vp_page_count()) { ?> <li><a href="#" data-id="<?php echo vp_current_page()+1; ?>" class="properties-page">> next</a></li> <?php } ?> </ul> </div> </div> <?php break; case "map":?> <div id="propertymapview"> <div id="propertyordering" class="clearfix"> <div id="orderby"> <a href="#" id="viewlist" class="button">view list</a> </div> </div> <?php vp_map_markers($properties); ?> <div id="vp-map" style="width: 100%; height: 550px;"></div> </div> <?php break; case "featured": ?> <?php foreach ($properties $property) { ?> <div class="property"> <div class="left_column"> <div class="property_tagline badge_<?php echo str_replace(" ","_",$property->web_status); ?>"></div> <div class="property_image"> <a class="property_overview_thumb" href="<?php echo vp_propertyurl($property->vebraid); ?>" title="<?php echo $property->address_name; ?>"> <?php echo vp_propertyimage($property->vebraid,0,"property_image"); ?> </a> </div> </div> <div class="right_column"> <ul class="property_summary"> <li class="property_title"> <a href="<?php echo vp_propertyurl($property->vebraid); ?>"><?php echo $property->address_custom; ?><span><?php echo $property->property_type; ?></span></a> </li> <li class="property_address"><?php echo $property->address_display; ?></li> <li class="property_price">£<?php echo number_format($property->price,0,"",","); ?> <?php echo $property->price_postfix; ?></li> </ul> <div class="buttons clearfix"> <a href="<?php echo vp_propertyurl($property->vebraid); ?>" class="button">view details</a> </div> </div> </div> <?php } ?> <?php break; } } else { ?> <p>no matching properties found. please try alternative search criteria.</p> <?php } ?> <?php echo vp_list_footer();?> </div>
solved:
in vp-search.php changed:
<form action="<?php echo vp_get_search_link()?>" method="get">
to
<form action="<?php echo vp_get_search_link()?>/property-results/" method="get">
obviously replace /property-results/ page has properties shortcode in :)
Comments
Post a Comment