- This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I’m creating a child theme based off twentyeleven theme. I want to change the background color of body tag, but when I inspected the body element of twentyeleven with firebug, I noticed that there’s a body class named custom-background that’s preventing me from overriding the default gray background color. How do I tackle this? Thanks.
I commented out the template tag in the header.php file and I’m now able to change the body tag’s background-color in style.css.
So now I need to research more about what body_class() does and why I encountered this problem in the first place.
From what I’ve read so far, it has something to do with wordpress providing the functionality of being able to change a background depending on what type of page is being viewed (home page, single post page etc).
A detailed explanation will be appreciated, thanks!
The `` function is super important to keep for being able to target specific pages (like posts, pages, archives, etc.).
If it had a class of custom-background then that means that in the Background Settings page (I think that exists in newer WordPress installs) has something set already which you might simply be able to clear.
I figured body_class() was quite important too. Commenting it out was a temporary fix and an act of frustration ;-) That’s why I want to understand how it works so I can do things “properly”. I’ll go to Background Settings like you suggested, thanks.