title: Add conditions to existed WP_Query in Wordpress
body: <p>I want to add some filter to select needed posts like:</p>
  
  <pre><code>function exclude_post($query) {
      if ($query-&gt;is_home) {
  
         // Do some PHP code
  
      }    
      return $query;
  }
  
  add_filter('pre_get_posts', 'exclude_post');
  </code></pre>
  
  <p>How can I add new conditions to existed <strong>WP_Query</strong> instance <code>$query</code>?</p>