[resolved] Altering backgrounds in twenty eleven theme (6 posts)

  1. hamishtodd1
    Posted 3 years ago #

    Hey. Here's my site http://www.musicofthespheresgame.com

    What I'm trying to do is make it so that the different pages (accessible along the top bar) have different backgrounds.

    Google has taken me to numerous tutorials that look at this. Most of them are to do with editing body.page-id-9 in style.css. That doesn't seem to be possible at all though, because in the 2011 theme, the background isn't set there. It appears to be set in a place that you only have access to with the "appearance->background" functionality. I've tried putting a lot of stuff in style.css, and it never works, even when I tell "appearance->background" that I don't want it to show a background.

    Is there anything else I can do? Or is there something I'm missing?

  2. Pioneer Web Design
    Posted 3 years ago #

  3. hamishtodd1
    Posted 3 years ago #

    I have *always* had "<body <?php body_class(); ?>>" written in header.php.

    One thing that I'll say I've just discovered is that going to the source of the webpages, that phrase does NOT appear. The body tag has a load of different stuff in it. But I can't find that part of the source anywhere in my code.

  4. Andrew Nevins
    Forum moderator
    Posted 3 years ago #

    Are you familiar with CSS?

  5. Michael
    Forum Moderator
    Posted 3 years ago #

    the custom option in dashboard - appearance - background is writing (embedding) the styles into the head section, therefore it is more specific, and you might need to use !important with your page specific body background styles.

    or instead of !important try styling:
    body.custom-background.page-id-9 { .. }

    additionally, your background image url /wp-admin/uploads/2012/08/random-patterns.png is not found - possibly needs to be /wp-content/uploads/...

    this might work:
    background-image: url('http://www.musicofthespheresgame.com/wp-content/uploads/2012/08/random-patterns.png')!important;

  6. hamishtodd1
    Posted 3 years ago #

    Dude, I owe you many, many drinks. A combination of the second and third solutions sorted me out fine - I didn't have to use !important.

    What ever they pay you guys, it isn't enough.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.