randomly changing header image

images php coding issues or problems here.

Moderators: macek, egami, gesf

stephanie
New php-forum User
New php-forum User
Posts: 1
Joined: Thu Jul 28, 2011 12:00 am

randomly changing header image

Postby stephanie » Thu Jul 28, 2011 12:11 am

hi, i want to have a randomly changing header image. therefor i found this php code here:
http://www.totallyphp.co.uk/scripts/random_image.htm
my first question; where do i have to put this code within my wordpress site? i made a seperate randomimage.php file, is that right?
further i put 1.jpg and 2.jpg into my theme image folder, change the path and the image names in the php code
and to put the line: <?php include "randomimage.php"; ?> into my header.php
i guess into this string of my existing wp theme somehow:

Code: Select all

<a href="<?php bloginfo('url'); ?>"><img class="logo" src="<?php bloginfo('template_directory'); ?>/images/logo_pros.jpg" alt="<?php bloginfo('name'); ?>" /></a>

?
would be very nice if you could help, thank you!

Return to “PHP coding => Images”

Who is online

Users browsing this forum: No registered users and 1 guest

cron