title: wp_query initial leter of title
body: <p>What I am trying to do is create a wp_query so that the results are only of the initial letter of the title.</p>
  
  <p>This is how I displayed &amp; hyperlinked the letters &amp; numbers..</p>
  
  <pre><code>&lt;div class="align_Center"&gt;
  
  &lt;?php $args = array(
  "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","ALL"           ); ?&gt;
  
  &lt;?php
  
  for($x = 0; $x &lt; 37; $x++) { ?&gt;
  
  &lt;span style="color: #777;"&gt;&amp;nbsp;|&amp;nbsp;&lt;/span&gt;
  
  &lt;a href="../page-title-&lt;?php echo $args[$x]; ?&gt;" class="movie_lists"&gt;&lt;?php echo $args[$x]; ?&gt;&lt;/a&gt;
  
  &lt;?php } ?&gt;
  
  &lt;span style="color: #777;"&gt;&amp;nbsp;|&lt;/span&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>And this is my test page..</p>
  
  <pre><code>&lt;div class="col-md-6"&gt;      
  
  &lt;!-- ############################################## --&gt;
  &lt;!-- ############### PAGE TITLE T ################# --&gt;
  &lt;!-- ############################################## --&gt;
  
  &lt;p class="f_header"&gt;PAGE TITLE T&lt;/p&gt;
  
  &lt;?php
  
      global $wpdb;
      $first_char = 'T';
      $postids = $wpdb-&gt;get_col($wpdb-&gt;prepare("
      SELECT      ID
      FROM        $wpdb-&gt;posts
      WHERE       SUBSTR($wpdb-&gt;posts.post_title,1,1) = %s
      ORDER BY    $wpdb-&gt;posts.post_title",$first_char)); 
  
  if ($postids) {
  $args = array(
  
          'post__in'          =&gt; $postids,
          'post_type'         =&gt; 'post',
          'post_status'       =&gt; 'publish',
          'posts_per_page'    =&gt; -1,
          'caller_get_posts'  =&gt; 1
  
      );
  
      $query = new WP_Query( $args );
  
      if ($query-&gt;have_posts()) {
  
  ?&gt;
  
  &lt;table width="100%"&gt;&lt;!-- #### TABLE #### --&gt;
  
      &lt;?php
  
          while ($query-&gt;have_posts()) {
  
              $query-&gt;the_post();
  
      ?&gt;
  
      &lt;tr style="border-bottom: thin solid #111;"&gt;
  
          &lt;td class="movie_genre"&gt;    
  
              &lt;a href="&lt;?php the_permalink() ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;
  
          &lt;/td&gt;
  
      &lt;/tr&gt;
  
      &lt;?php }; ?&gt;
  
  &lt;/table&gt;&lt;!-- #### / TABLE #### --&gt;
  
  &lt;?php }; wp_reset_postdata(); }; ?&gt;
  </code></pre>
  
  <p></p>
  
  <p>The test page is currently saved as page-title-t in the root theme dir at present it is not giving out any data whatsoever, so I am a bit baffled.</p>