?> <div id="content" class="<?php echo $content_class; ?> "> <div class="title title-archive clearfix"><?php echo apply_filters('wpsight_search_title', wpsight_listing_loop_title()); // Action hook to add content to title do_action('wpsight_loop_title_actions', $wp_query); ?> </div><!-- .title --><?php // Action hook to add content after archive title do_action('wpsight_listing_archive_title_after', wpsight_listing_search_query_args(), $content_class); if (have_posts()) { ?> <div class="row"> <?php // Create loop counter $counter = 0; while (have_posts()) { // Increase loop counter $counter++; the_post(); // Include listing loop template get_template_part('loop', 'listing'); }
function wpsight_listing_search_query($query) { if (is_search() && $query->is_main_query() && !is_admin()) { // Check type of search $stype = isset($_GET['stype']) ? true : false; if ($stype === false || $stype != 'default') { // Get listing search query $args = wpsight_listing_search_query_args(); foreach ($args as $k => $v) { $query->set($k, $v); } } } return $query; }