Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
// functions.php
function wpb_bg() {
$rand = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f');
$color ='#'.$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].
$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)];
echo $color;
}
?>
<body
<?php
// page.php or whatever page file you are using.
body_class(); ?> style="background-color:<?php wpb_bg();
?>"
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.