Support » Themes and Templates » List categories with alphabetical headings

  • I found a code to list my categories in 2 columns but now I want it to show the alphabetical headings for example So does anyone know how? don’t say use a plugin because I’m trying to use less plugins to save performance.

    $cats = explode("<br />",wp_list_categories('title_li=&echo=0&depth=1&style=none'));
    $cat_n = count($cats) - 1;
    for ($i=0;$i<$cat_n;$i++):
    if ($i<$cat_n/2):
    $cat_left = $cat_left.'<li>'.$cats[$i].’</li>’;
    elseif ($i>=$cat_n/2):
    $cat_right = $cat_right.’<li>’.$cats[$i].’</li>’;
    <ul class=”left”>
    <?php echo $cat_left;?>
    <ul class=”right”>
    <?php echo $cat_right;?>
Viewing 1 replies (of 1 total)
  • It seems you have been able to solve this, can you tell me how you did it?

    I’m looking for a way do to something similar, but with an addition of norwegian characters.

Viewing 1 replies (of 1 total)
  • The topic ‘List categories with alphabetical headings’ is closed to new replies.