TwentyTen: how to add random images?
-
I need to customize TwentyTen theme by adding random images.
In WP 2.X theme “falling_dreams” I used this function:<?php
function header_graphic() {
echo “/images/”;
$num=rand(0,24);
echo “dream”.$num.”.jpg”;
};
?>Then in <head> section included:
#header {
background: url(“<?php bloginfo(‘stylesheet_directory’); header_graphic(); ?>”) no-repeat bottom center;
}And in the <body> section this line:
<div id=”wrapper”>
<h1 id=”header” onclick=”location.href='<?php bloginfo(‘url’); ?>’;” style=”cursor: pointer;”>And I had 25 header images appearing at random order.
I wish I could do the same in TwentyTen theme, but as soon as I add header_graphic() function, I get an error message that this function is already defined in wp-includes/theme.php
Can anyone post here what exactly where I need to change to show random images in the header?
- The topic ‘TwentyTen: how to add random images?’ is closed to new replies.