title: Search result is disappearing when I search from the search result in wordpress
body: <p>I am designing a theme for a job aggregation website (currently I am using default one which is twenty fourteen).</p>
  
  <p>I am facing a problem is that when I search from a category page with proper keywords I get the result. and from the search result page I again search using a term not in the data base it shows nothing found.</p>
  
  <p>Till this everything properly happening. But if I search once more using a keyword which is not in the data base it shows nothing found and change the category to null. So if I search again with proper keyword the result shows from other categories.</p>
  
  <p>Here is the link to the website</p>
  
  <p><a href="http://alltopjobs.net/country/india" rel="nofollow">http://alltopjobs.net/country/india</a></p>
  
  <p>And here is the search.php code</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  /**
   * The template for displaying Search Results pages
   *
   * @package WordPress
   * @subpackage Twenty_Fourteen
   * @since Twenty Fourteen 1.0
   */
  
  get_header(); ?&gt;
  &lt;?php
  if ($_GET['cat'] != '') {
   $posts = query_posts($query_string . '&amp;post_type=post'); // return only posts
  } else {
   $posts = query_posts($query_string . '&amp;post_type=page'); // return only posts
  }
  ?&gt;
  &lt;?php $category = get_the_category(); ?&gt;
  &lt;form  method="get" id="jobsearch" action="&lt;?php bloginfo('home'); ?&gt;"&gt;
   &lt;input type="text" placeholder="Search any jobs here..." required value="&lt;?php echo wp_specialchars($s, 1); ?&gt;" name="s" id="s" /&gt;
       &lt;input type="hidden" name="cat" value="&lt;?php echo $category[0]-&gt;cat_ID; ?&gt;" /&gt;
   &lt;button type="submit" id="jobsubmit" value="Search Jobs" /&gt;FIND JOBS&lt;/button&gt;
  &lt;/form&gt;
  
   &lt;section id="primary" class="content-area"&gt;
    &lt;div id="content" class="site-content" role="main"&gt;
  
     &lt;?php if ( have_posts() ) : ?&gt;
  
     &lt;header class="page-header"&gt;
      &lt;h1 class="page-title"&gt;&lt;?php printf( __( 'Search Results for: %s', 'twentyfourteen' ), get_search_query() ); ?&gt;&lt;/h1&gt;
     &lt;/header&gt;&lt;!-- .page-header --&gt;
  
      &lt;?php
       // Start the Loop.
       while ( have_posts() ) : the_post();
  
        /*
         * Include the post format-specific template for the content. If you want to
         * use this in a child theme, then include a file called called content-___.php
         * (where ___ is the post format) and that will be used instead.
         */
        get_template_part( 'content', get_post_format() );
  
       endwhile;
       // Previous/next post navigation.
       twentyfourteen_paging_nav();
  
      else :
       // If no content, include the "No posts found" template.
       get_template_part( 'content', 'none' );
  
      endif;
     ?&gt;
  
    &lt;/div&gt;&lt;!-- #content --&gt;
   &lt;/section&gt;&lt;!-- #primary --&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>No idea how to solve this issue.
  Any solution for this problem highly appreciated.
  Thank you </p>