Didn’t test this much but could try:
<?php
// for use in category template, get link to previous/next (alphabetic) categories
if ( is_category() ) {
$current_cat = get_query_var('cat');
$previous = -1;
$next = 0;
$count = 0;
$args = array(
'orderby' => 'name',
'order' => 'ASC',
'hierarchical' => 0,
'hide_empty' => 1
);
$categories = get_categories($args);
foreach ($categories as $cat) {
$count++;
if ($cat->cat_ID == $current_cat) {
$previous = $count - 2;
$next = $count;
}
}
if ($previous >= 0) {
echo '<p>Previous category is: <a href="' . get_category_link( $categories[$previous]->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $categories[$previous]->name ) . '" ' . '>' . $categories[$previous]->name.'</a> </p> ';
}
if ($next > 0 && $next < count($categories)) {
echo '<p>Next category is: <a href="' . get_category_link( $categories[$next]->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $categories[$next]->name ) . '" ' . '>' . $categories[$next]->name.'</a> </p> ';
}
}
?>