Created
November 26, 2013 04:02
-
-
Save johnReeve/7653289 to your computer and use it in GitHub Desktop.
Function to generate a random class name for a post body (kinda stupid obvious, I suppose)
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
<article <?php post_class('clearfix ' . oneMenu_randomColor() ); ?>></article> |
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
function oneMenu_randomColor () { | |
$colorList = array ( | |
'cyan', | |
'orange', | |
'yellow' | |
); | |
shuffle($colorList); | |
return array_pop($colorList); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment