I wrote a tutorial on Creating an Alphabetical Glossary of Posts but here are the most relevant parts.
First create a hidden taxonomy for the letters of the alphabet
// Add new taxonomy, NOT hierarchical (like tags)
function kia_create_glossary_taxonomy(){
if(!taxonomy_exists('glossary')){
register_taxonomy('glossary',array('post'),array(
'show_ui' => false
));
}
}
add_action('init','kia_create_glossary_taxonomy');
Then when any post is saved, save the first letter as the term in the glossary taxonomy
/* When the post is saved, saves our custom data */
function kia_save_first_letter( $post_id ) {
// verify if this is an auto save routine.
// If it is our form has not been submitted, so we dont want to do anything
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
return;
//check location (only run for posts)
$limitPostTypes = array('post');
if (!in_array($_POST['post_type'], $limitPostTypes)) return;
// Check permissions
if ( !current_user_can( 'edit_post', $post_id ) )
return;
// OK, we're authenticated: we need to find and save the data
$taxonomy = 'glossary';
//set term as first letter of post title, lower case
wp_set_post_terms( $post_id, strtolower(substr($_POST['post_title'], 0, 1)), $taxonomy );
//delete the transient that is storing the alphabet letters
delete_transient( 'kia_archive_alphabet');
}
add_action( 'save_post', 'kia_save_first_letter' );
And voila, now know you have terms A, B, C, etc that should each contain all the posts whose titles began with that letter.