ricketts8
Member
Posted 1 year ago #
(first, I know about child themes, please do not tell me to make child themes and then not answer my query)
I would like to write CSS for my background image instead of using the background image selector via the admin panel. I've searched Google for a way to deactivate this function and haven't found a good answer. Anyone know how to deactivate the Theme's Background Image Selector and write CSS instead?
you can just ignore the background image selector & set the background using css as you normally would.
for example:
body {
background: #E7CA30 url(images/bg.png) repeat fixed;
}
ricketts8
Member
Posted 1 year ago #
What do you mean by 'nope'?
ricketts8
Member
Posted 1 year ago #
Sorry, just frustrated. No, the code you suggested didn't do anything. I've tried several different variations in CSS to get it to show and nothing's happening. Yet when I go in through the admin panel it changes right away.
the cause is that the 'background function' embeddes the styles into the head area, which gives it precedence over styles in style.css.
you can force the body background in the style.css to rule by adding !important; for instance:
body {
background: #E7CA30 url(images/bg.png) repeat fixed!important;
}
If there is no image specified within the background image selector, it doesn't put anything into the head area. I copied & pasted that css example directly from a twentyten child theme I'm running on a site.
ricketts8
Member
Posted 1 year ago #
Okay, so both options seem to work. Thanks.
Here's a follow-up
htmlgiant.com
It seems, looking through Firebug, this site has two background images. I've replicated the code in my stylesheet (twenty-ten) but it isn't exactly working.
Any idea how to replicate that? I'm experimenting as we speak but I can't get it to go.