function widget($args, $instance)
    {
        global $post, $wpdb;
        echo $args['before_widget'];
        echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
        if ($instance['search_page'] == 'default') {
            $action = get_permalink();
        } else {
            $action = get_post_meta($post->ID, '_wp_page_template', true) == 'template-bshListingPage.php' ? '' : get_permalink($instance['search_page']);
        }
        ?>

		<form class='custom inContentSearch' action='<?php 
        echo $action;
        ?>
' method='get'>
			<?php 
        $search = array('customdatas' => array(), 'custom_taxonomies' => array());
        $search['customdatas'] = $instance['est_customdata'];
        $search['custom_taxonomies'] = $instance['est_taxonomies'];
        $details = get_search_options($search);
        est_vertical_search($details);
        $text = $instance['search_button_text'];
        $text = empty($text) ? 'Search' : $text;
        ?>

				<div class='form-row row mt11'>
					<div class='small-12 large-12 columns text-right'>
						<input type='submit' class='button' value='<?php 
        echo $text;
        ?>
'>
					</div>
				</div>

		</form>


		<?php 
        echo $args['after_widget'];
    }
'>
			<?php 
    $title = get_post_meta($post->ID, '_est_search_title', true);
    if (!empty($title)) {
        ?>
			<div class='searchTitle'>
				<div class='title'><?php 
        echo $title;
        ?>
</div>
			</div>
			<?php 
    }
    ?>
			<?php 
    est_vertical_search($details, array('sliders' => false));
    ?>
		</form>

		<?php 
    dynamic_sidebar(bsh_get_sidebar());
    ?>

	</div>
	<div class='large-8 small-12 columns <?php 
    echo $class_content;
    ?>
'>
		<div id='siteContent' class='nopadding nobgcolor'>
			<div id='filterNoResults' style='display:none'>
				<h1><?php 
            ?>
					<div class='searchTitle'>
						<div class='title'><?php 
            echo $title;
            ?>
</div>
					</div>
					<?php 
        }
        ?>
					<?php 
        $search = array('customdatas' => array(), 'custom_taxonomies' => array());
        $search['customdatas'] = get_post_meta($post->ID, '_est_customdatas', true);
        $search['custom_taxonomies'] = get_post_meta($post->ID, '_est_taxonomies', true);
        $details = get_search_options($search);
        est_vertical_search($details);
        $text = get_post_meta($post->ID, '_est_search_button_text', true);
        $text = empty($text) ? 'Search' : $text;
        ?>
						<div class='form-row row mt11'>
							<div class='small-12 large-12 columns text-right'>
								<input type='submit' class='button' value='<?php 
        echo $text;
        ?>
'>
							</div>
						</div>
				</form>
				<?php 
    }
    ?>