Glossary with Custom Post Type

$index = 0;
$terms = get_terms('marke');
$range = array_merge(range(0, 9), range('A', 'Z'));

echo '<ul>';
foreach ($terms as $term) {

    if(ord($range[$index]) <= ord(strtoupper(substr($term->name, 0, 1)))) {
        while($range[$index] != strtoupper(substr($term->name, 0, 1))) {
            echo '<li>'. $range[$index] . '</li>';
            $index++;
        }
        $index = strtoupper(substr($term->name, 0, 1));
        echo "<li><a href="".get_term_link($term)."" />{$range[$index]}</a></li>";
        $index++;
    }

}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)