Это должно работать:
<?php
$args = array(
'orderby' => 'title',
'order' => 'ASC',
'caller_get_posts' => 1,
'posts_per_page' => -1,
);
query_posts($args);
?>
<?php
if (have_posts()) {
$curr_letter = '';
while (have_posts()) {
the_post();
$this_letter = strtoupper(mb_substr(mb_convert_encoding($post->post_title,'UTF-8'),0,1));
if ($this_letter != $curr_letter) {
echo "<span>$this_letter</span>";
$curr_letter = $this_letter;
}
?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
<?php }
}
?>