siga
10/20/2015 - 7:20 PM

Modified search function http://cobaltapps.com/forum/forum/main-category/main-forum/82179-finally-success-getting-search-to-behave-the-way-i

/* this doesn't get processed early enough if created in hook boxes, so leave in custom functions */
add_action( 'pre_get_posts' , 'your_modify_search' );
function your_modify_search( $query ) {
     if ( ! $query->is_main_query() ) return;
     /* else is main query, so process search target */
     if ( $query->is_search ) {
          $query->set( 'post_type' , 'post' ); /* search posts only, not pages or other */
          /* test for search text stored in [s] set to a value, but empty */
          if ( isset($_GET['s']) && empty($_GET['s']) ) $query->set( 's' , "[empty search text ]" ); /* sub in whatever empty text you want to use */
     }
     return;
}