Created
July 25, 2011 21:38
-
-
Save johnathan-sewell/1105298 to your computer and use it in GitHub Desktop.
Wordpress tag cloud as multiple HTML lists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$mytags = get_tags() ; | |
if ($mytags) { | |
echo '<ul>'; | |
for ($x = 0; $x <= count($mytags); $x++) { | |
if (($x > 0) && ($x % 3 == 0)) echo '</ul><ul>'; | |
echo '<li>'; | |
echo '<a href="' . get_tag_link($mytags[$x]->term_id) . '">' . $mytags[$x]->name . '</a>'; | |
echo '</li>'; | |
} | |
echo '</ul>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment