简体   繁体   中英

Search results form to show another page

I am using a Vebra plugin on Wordpress, they use shortcodes to show a search area and a shortcode to show the results.

I have my homepage ( http://lytham.voodoodev4.co.uk/ ) using the "search" shortcode, my "properties" shortcode is on http://lytham.voodoodev4.co.uk/?page_id=33

When I search on the page it just refreshes the page, how do I push the search results to that 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 your 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 for property</p> <?php vp_get_minrent(); ?> </div> <div class="property_search_group vp_rent"> <p>Maximum rent for 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 as $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">&pound;<?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">&lt; 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">&gt; 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 as $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">&pound;<?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 the vp-search.php I 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/ for the page that has the properties shortcode in it :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM