How to randomly change your header image.
written on : April 22, 2008 – 9:51 amby : Mus_
Hey, look at my header image. Try to click any page/post within this blog. You will get different header images almost in every page/post in my blog.
How to do that? It’s simple, and little bit tricky.
Read and follow the instructions bellow.
- You should have at least 2 different images for your blog’s header. Remember that you should have the same image size and the same extension in each images. For example, if you are using an images with .jpg extension, make sure that each image has the .jpg extension.
- Rename each images with the identical file name but number of file. As my blog’s using 5 images named : potrait_1.jpg, potrait_2.jpg, potrait_3.jpg, potrait_4.jpg, potrait_5.jpg. Put / upload all images in a same directory in your webhosting / server.



- Open your header.php file or any .php file that you desired the image to be shown. Then write this following code to your .php file. :
<?php echo(rand(1,5)); ?>
And here is the example :
- Save, and put / upload that .php file to the right place / directory in your webhosting / server.
- Open your blog, then try to refresh or open different page / post within your blog.
Try again, recheck the code, recheck the path, and recheck image file name, if you experience any errors / problems when following this tutorial.
Or write your comments bellow.
posted under category tutorial
tags: php, trick, tutorial, wordpress trick
6 comments to “How to randomly change your header image.”
-
tukang foto keliling Says:
April 22nd, 2008 at 1:44 pmnice simple tips…
thats really useful -
baliazura Says:
April 22nd, 2008 at 4:38 pmnow I know

-
amril Says:
April 22nd, 2008 at 7:44 pmYou’re the “Real Proffessor” Mus!. Thanks for the tips, but I’m still a “gaptek man”..hehehe
-
mamie Says:
April 22nd, 2008 at 8:16 pmgenius..!! thank u very much prof. could u please make one more trial on my web?

-
ndop Says:
April 23rd, 2008 at 4:16 amemangnya bisa ya.. oo.. bukannya css nya wordpress disuruh beli dulu.. coba saya cek lagi ah..
*sori, panjenengan orang endonesa toh, paham toh dg bhs endonesa?*
-
instructions com Says:
May 9th, 2008 at 11:33 am[...] images almost in every page/post in my blog.How to do that? Follow the instructions in this page.http://www.profmustamar.com/how-to-randomly-change-your-header-image/2008/04/22/Download ManualDownload manuals user manuals and instructions. … So be sure to keep us in mind [...]





