TAGS
A
B
C
I
L
M
P
R
S
Tag Explorer
false,
'orderby' => 'name',
'order' => 'ASC'
));
if (empty($tags)) {
echo '
No tags found on this site.
';
} else {
// Organize tags by alphabet
$organized_tags = array();
// Initialize alphabet array
for ($i = 65; $i <= 90; $i++) {
$organized_tags[chr($i)] = array();
}
// Sort tags into alphabet buckets
foreach ($tags as $tag) {
$first_letter = strtoupper(substr($tag->name, 0, 1));
if (isset($organized_tags[$first_letter])) {
$organized_tags[$first_letter][] = $tag;
}
}
// Generate HTML for each letter section
foreach ($organized_tags as $letter => $letter_tags) {
if (empty($letter_tags)) continue;
echo '';
echo '
';
}
}
?>
';
echo '
';
echo '';
echo '' . $letter . '';
echo '(' . count($letter_tags) . ')';
echo '
';
echo '▼';
echo '';
echo '
';
echo '';
foreach ($letter_tags as $tag) {
$tag_link = get_tag_link($tag->term_id);
echo '';
echo '' . esc_html($tag->name) . '';
echo '' . $tag->count . '';
echo '';
}
echo '
';
echo '