Support » Themes and Templates » Assign a different background image if there is a header/featured image

  • Resolved LClark52

    (@lclark52)


    Hi,

    I’m using the Twenty Ten theme. I have a unique background on my homepage.
    What I want to do is, assign different backgrounds to other pages and posts; so I’m trying to code something like this:

    Homepage: assign image A to background
    For other pages & posts:
    Test: is there a header/featured image?
    If yes -> assign image B to background,
    If not -> assign image C to background

    What I have done so far in the header.php is this:

    <body <?php if (function_exists('body_class')) body_class(); ?>>

    but I can’t figure out how to code the rest.

    Many thanks in advance for your help.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Assign a different background image if there is a header/featured image’ is closed to new replies.