JoeHana
7/9/2013 - 6:21 PM

Display Search Form at the Bottom (instead of top)

Display Search Form at the Bottom (instead of top)

<?php

/**
 * Remove default actions
 */
add_action('init', 'custom_init');

function custom_init() {
	remove_action( 'wpsight_main_before', 'wpsight_place_listing_search' );
}

/**
 * Display Search Form at the Bottom (instead of top)
 */
add_action('wpsight_main_after', 'custom_place_listing_search');

function custom_place_listing_search() {

	$search_show = wpsight_get_option( 'search_show', false );
	
	if( $search_show['search'] && is_search() && ! isset( $_GET['stype'] ) ) {
		$show = true;
	} elseif( $search_show['archive'] && ( is_tax( 'location' ) || is_tax( 'feature' ) || is_tax( 'listing-type' ) || is_tax( 'listing-category' ) ) ) {
		$show = true;
	} elseif( $search_show['templates'] && is_page_template( 'page-tpl-listings.php' ) ) {
		$show = true;
	} elseif( $search_show['author'] && is_author() ) {
		$show = true;
	} else {
		$show = false;
	}
	
	$show = apply_filters( 'wpsight_place_listing_search', $show );
	
	if( $show == true )
		wpsight_do_listing_search();

}