Created
November 1, 2013 07:20
-
-
Save zakhardage/7261926 to your computer and use it in GitHub Desktop.
Colored links from post tags. Example: http://www.lmaeboutique.com/blog/
This file contains hidden or 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
| <div class="widget"> | |
| <h3>Style by Color</h3> | |
| <?php | |
| $tags = get_tags(); | |
| foreach ($tags as $tag) { | |
| $tag_link = get_tag_link( $tag->term_id ); | |
| $background = ' ' . $tag->slug; | |
| $html .= "<a href='{$tag_link}'><span style='background:{$tag->slug};'></span>"; | |
| $html .= "{$tag->name}</a>"; | |
| } | |
| echo $html; | |
| ?> | |
| </div> <!-- end .widget --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment