title: Wordpress get result from title (anywhere), not just first word
body: <p>Currently this is working code that is queried as standalone search.php.</p>
  
  <p>I have an issue that it searches beginning of title and not anywhere in title what I exactly need.</p>
  
  <p>I have a feeling that I'm close to solution and I tried couple of things and it is probably something that I'm missing in post $args..</p>
  
  <pre><code>global $wp_query;
  $type = 'qa';
  $args=array(
    'post_type' =&gt; $type,
    'post_status' =&gt; 'publish',
        'showposts'=&gt;100,
        'orderby'=&gt; 'menu_order',
        'order' =&gt; 'DESC'
  );
  $my_query = null;
  $my_query = new WP_Query($args);
  $data = array();
  if( $my_query-&gt;have_posts() ) {
        while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post();
        $title = get_the_title();
        $url = get_the_permalink();
        $data[$title] = $url;
    endwhile;
  }
  
  if(isset($_POST['latestQuery'])){
   $latestQuery = $_POST['latestQuery'];
   $latestQueryLength = strlen($latestQuery);
   $result = array();
   foreach($data as $name =&gt; $url){
     if (substr(strtolower($name),0,$latestQueryLength) == strtolower($latestQuery)){
         $result[$name] = $url;
     }
   }
   echo json_encode($result);
  }
  </code></pre>
  
  <p>This is already working in local environment. </p>
  
  <p>JavaScript queries search.php file (above) where it gets json array returned based on query... for example "cla.."</p>
  
  <pre><code>{"Classic something":"http:\/\/www.something\/qa2","Classic something else":"http:\/\/www.something\/qa"} 
  </code></pre>
  
  <p>So I have properly retuned two items that only have "Classic" mentioned in post title.</p>
  
  <p>If I type "som" or "els" it doesn't return anything and it should match as well all "some" and "else" items.</p>
  
  <p>I think it is not an issue with javascript code but with PHP code.</p>
  
  <p>Thanks!</p>