title: Wordpress - Make search only search children of a specific page
body: <p>I have a Wiki section on my site, and I want to modify WordPress's native search to only search pages in this Wiki, or in other words, only children of page #278.
  I've succeeded in listing children pages of a given page with wp_list_pages and the parameter 'child_of', so I've been trying for something like that. Two attempts so far:
  In the search page...</p>
  
  <pre><code>&lt;?php if ( have_posts(array('child_of'=&gt;278)) ) : ?&gt;
  ...
  &lt;?php while ( have_posts(array('child_of'=&gt;278)) ) : the_post(array('child_of'=&gt;278)) ?&gt;
  </code></pre>
  
  <p>And alternatively in my functions file...</p>
  
  <pre><code>function SearchWikiPages($query) {
      if ($query-&gt;is_search) {
          $query-&gt;query_vars['child_of']=278;
      }
      return $query;
  }
  add_filter('pre_get_posts','SearchWikiPages');
  </code></pre>
  
  <p>So far with no luck. If anyone knows how I can do this please help. I would not be opposed to using a plugin, or any other creative solution if it gets what I need.
  Thanks!</p>