Skip to content

Instantly share code, notes, and snippets.

@johnReeve
Created November 26, 2013 04:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnReeve/7653289 to your computer and use it in GitHub Desktop.
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)
<article <?php post_class('clearfix ' . oneMenu_randomColor() ); ?>></article>
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