Wordpress - Load Random Background Image Problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
MsBecks
Forum Newbie
Posts: 1
Joined: Sat Jan 21, 2012 12:09 pm

Wordpress - Load Random Background Image Problem

Post by MsBecks »

Hi There,

I used the code found in the following PHP tutorial to randomly load different background images to an html element of my choosing. I implemented it and it works well, but now I'm wondering how to tweak it.

http://www.thought-after.com/2006/05/cs ... mment-8735

I used the code to load a random background image to the date area that appears for all blog posts in my theme. So, I have now 6 different images in a folder named "random_bg" and the script chooses which of the six to load and loads the same image for all posts. It then changes images when a user refreshes the page.

What I'd like to do instead is tweak the code to have the script choose a different image for each blog post.

Can anyone review and tell me what I'd need to do? Any assistance at all will be a HUGE help.

Thanks,

Dionne
Post Reply