Created
April 19, 2010 16:58
-
-
Save jamiew/371288 to your computer and use it in GitHub Desktop.
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
<?php | |
// Add some dope ASCII art to yr blog, dynamically generated via `figlet` | |
// | |
// I'm using some cool custom figlet fonts you may or may not have -- check 'showfigfonts` | |
// Toss this into your theme's index.php and/or archive.php | |
// Also, you'll want to cache this -- try WPSuperCache | |
// --jdubs <http://jamiedubs.com> | FAT <http://fffff.at> | |
if(is_category() || is_tag()) { | |
print '<div class="ascii-art"><pre>'."\n"; | |
$current_category = str_replace('"', '', single_cat_title("", false)); | |
$fonts = array('crawford', 'cosmic', 'cosmike', 'utopiab', 'univers', 'roman', 'poison', 'epic', 'colossal'); | |
$font = $fonts[floor(rand() % count($fonts))]; | |
print system("figlet -w 140 -S -f $font \"$current_category\""); | |
print "\n<!-- figlet font: $font -->\n"; | |
print '</pre></div>'."\n"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment