Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm working an a Thematic child theme wherein I need to have a unique image decorating each of the site's main pages, from a pre-defined set of permanent images. It would also be ideal to have one of these same images randomly selected to appear on all other pages.

Using a sidebar widget to load the images seems like a good option, but I don't know how to create my own widgets yet, and haven't had any luck finding a plugin which provides the simple functionality I'm looking for. I also don't want to clutter up the admin panel with plugins and options that the client shouldn't be fiddling with.

I think it will probably be most ideal to put something into my functions.php which adds some generated markup to a Thematic hook based on the page ID, but I'm not quite sure what I'm doing, so I thought I should ask to see if someone already has a great solution.

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

Looking at their demo source, the easiest way to do this is by styling page classes like pageid-69 or slug-example-page:

body.slug-example-page{
  background: url(...);
}

If it has to be random image, add your styles in the header template so you can use PHP to generate dynamic css.

share|improve this answer
    
Thanks, that should get it done. –  Dees Jan 3 '11 at 21:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.