Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Display of categories with this first letter
- $categories = get_categories();
- foreach ($categories as $cat) {
- $thecats[strtoupper(substr($cat, 0, 1))] = $cat;
- }
- if ($thecats) echo '<ul>';
- for ($i=65; $i< =90; $i++) {
- $x = chr($i);
- if ($thecats[$x]) {
- echo '<li>' . $x . '<ul>';
- foreach ($thecats[$x] as $c) {
- '<li><a href="' . get_category_link($c->term_id) . '">' . $c->name . '</a></li>';
- }
- echo '</ul></li>';
- }
- }
- if ($thecats) echo '</ul>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement