// List posts alphabetically under first letter of title
$args = array(
  'orderby' => 'title',
  'order' => 'ASC',
  'caller_get_posts' => 1,
  'posts_per_page' => 20,
 );
query_posts($args);
if (have_posts()) {
   $curr_letter = '';
   while (have_posts()) {
      the_post();
      $this_letter = strtoupper(substr($post->post_title,0,1));
      if ($this_letter != $curr_letter) {
         echo "

# $this_letter #

";
         $curr_letter = $this_letter;
      }
      ?>
      
      <a href="" rel="bookmark" title="Permanent Link to ">
   <?php }
}

Advertisements