so nice …
put this into a html tag (e.g. <div>) …
style="background-color: <!--?php thats_random_color(); ?-->;"
after you put this in youre functions.php …
function thats_random_color() { $rand = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'); $thats_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 $thats_color; }
courtesy: Pratik K. Yadav