Wordpress - Load Random Background Image Problem

images php coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Sat Jan 21, 2012 8:21 am

Wordpress - Load Random Background Image Problem

Postby MsBecks » Sat Jan 21, 2012 8:30 am

Hi There,

I'm a noob to coding and am trying to learn by creating a custom Wordpress theme. So far, everything's been going well.

I found a tutorial over here:


That explained how 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.

I used the coding 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.



Return to “PHP coding => Images”

Who is online

Users browsing this forum: No registered users and 1 guest