StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
  #1  
Old 07-20-2009, 04:44 AM
NikkiB74 NikkiB74 is offline
Registered User
Pro Plus Member
 
Join Date: Jul 2009
Posts: 39
Default How to Change the Background to an Image

I'm sure this has been covered but I searched the forum and could only find the tutorial on changing the colour viewtopic.php?f=15&t=3894

I'd like to change the color of the bg to an image. I have an image, I've renamed it bg.gif and ftp'd it over to my images folder. Within the text editor I have tried taking out the hex code before the (images/bg.gif) as this seemed to be overiding it, but since removing it I just get a white bg.

What is the glaringly obvious thing that I am missing?

url is http://nikkibackshall.com

Thank you,
  #2  
Old 07-20-2009, 05:30 AM
adew adew is offline
Community Moderator
 
Join Date: Oct 2008
Location: Genève, Suisse
Posts: 14,270
Default Re: How to Change the Background to an Image

Nikki,

Replace the hex code with the word transparent. That should do it.
__________________
Ade
Themessence - Studiograsshopper

WordPress plugins: Dynamic Content Gallery | Reveal Page Templates | Custom Taxonomies Menu Widget

Check out the Genesis and Child Theme tutorials before posting your question - and please provide YOUR URL!
Make Andrea happy - read her Firebug tutorial and save yourself loads of time and effort.
  #3  
Old 07-20-2009, 05:57 AM
CharlesClarkson's Avatar
CharlesClarkson CharlesClarkson is offline
Community Moderator
 
Join Date: Feb 2009
Location: Stephenville, TX, USA
Posts: 11,356
Default Re: How to Change the Background to an Image

Quote:
Originally Posted by NikkiB74
What is the glaringly obvious thing that I am missing?
You attached an image text instead of pasting the actual text. :)

First, you are also missing the "url" in front of the url in the style sheet:
Code:
body {
	background: (images/bg.gif) top center repeat-y;
	color: #333333;
	font-size: 12px;
	font-family: Arial, Tahoma, Verdana;
	margin: 0px auto 0px;
	padding: 0px;
	}
Should be:
Code:
body {
	background: #ebebeb url(images/bg.gif) top center repeat-y;
	color: #333333;
	font-size: 12px;
	font-family: Arial, Tahoma, Verdana;
	margin: 0px auto 0px;
	padding: 0px;
	}
Second, you are centering the background image at the top of the page and then repeating it down the page (top center repeat-y). Since you have content in the foreground, the background image is completely blocked by the content.

So, I have to ask: How do you know this is not working, if you can't see what is behind the content?

Add this little JavaScript to your header (header.php) and perhaps things will become clear:
Code:
<script type='text/javascript'>
    jQuery(document).ready(function($) {
        $('body div, div *').css('background-color', 'transparent').css('background', 'none');
    });
</script>

HTH,
__________________
Charles "Rubeus Hagrid" Clarkson
StudioPress on Facebook

I'm not really a smart person. I just play one on the Internet.

Please use the HTML or PHP tags for pasting code.
Please make your links click-able: this_is_annoying.com
http://this_is_not_annoying.com.
  #4  
Old 07-20-2009, 06:27 AM
NikkiB74 NikkiB74 is offline
Registered User
Pro Plus Member
 
Join Date: Jul 2009
Posts: 39
Default Re: How to Change the Background to an Image

Quote:
Originally Posted by CharlesClarkson
You attached an image text instead of pasting the actual text. :)
Apologies for that - I was fiddling with it after I posted! The "url" was initially infront with the same results.

Quote:
Originally Posted by CharlesClarkson
Second, you are centering the background image at the top of the page and then repeating it down the page (top center repeat-y). Since you have content in the foreground, the background image is completely blocked by the content.

So, I have to ask: How do you know this is not working, if you can't see what is behind the content?
Well, because I am only a beginner in WordPress, I assumed that if you can put a hex code in there and have it change the whole bg color then an image url would do the same thing. I'm still not sure why that isn't the case. If the content is the hex code, then I presumed that by removing it (or changing it to transparent) - it would allow the image to show - obviously not. The "top center repeat-y" was already there within the code and not something I added, so I figured it had better stay.

I put the piece of javascript in my header.php and it wiped out the whole header and turned my #wrap white too (I previously had this set to a light green #dfffe0).

I took out the code again and everything has returned to normal - except the #wrap which is now just taking on the color of the background *sigh*

ADE - I also tried changing the hex to transparent but this didn't do anything either. Sooo, I'm obviously not destined to be a WP stylist and will just stick to the basic colours - but would like my #wrap back if anyone knows how I can return it?

I'm sure that when I've changed bg colours before it was just a case of replacing the existing bg image within my image folder (or just the hex within the editor if it wasn't an image) - the same kinda thing as you do with logo.png. But it's been a while since I did it so I'm obvioulsy in a kerfuffle! <---- Love that word - any excuse to use it :D

(I'm still baffled as to why I can add a piece of code which changes stuff and then remove it again and it not just return to what it was, prior to me adding the code in the first place :? )
  #5  
Old 07-20-2009, 06:44 AM
adew adew is offline
Community Moderator
 
Join Date: Oct 2008
Location: Genève, Suisse
Posts: 14,270
Default Re: How to Change the Background to an Image

Quote:
ADE - I also tried changing the hex to transparent but this didn't do anything either. Sooo, I'm obviously not destined to be a WP stylist and will just stick to the basic colours - but would like my #wrap back if anyone knows how I can return it?
Nikki,

Is the idea that the tartan image will tile across the screen, like this?
[attachment=0:2juv8v7f]Nikki_bg.png[/attachment:2juv8v7f]
If so, in your CSS for the BODY tag, you should have this:
Code:
background: transparent url(images/bg.gif) repeat;
Quote:
(I'm still baffled as to why I can add a piece of code which changes stuff and then remove it again and it not just return to what it was, prior to me adding the code in the first place :? )
We'd all like to the answer to that one. It happens to us all from time to time!
__________________
Ade
Themessence - Studiograsshopper

WordPress plugins: Dynamic Content Gallery | Reveal Page Templates | Custom Taxonomies Menu Widget

Check out the Genesis and Child Theme tutorials before posting your question - and please provide YOUR URL!
Make Andrea happy - read her Firebug tutorial and save yourself loads of time and effort.
  #6  
Old 07-20-2009, 06:50 AM
NikkiB74 NikkiB74 is offline
Registered User
Pro Plus Member
 
Join Date: Jul 2009
Posts: 39
Default Re: How to Change the Background to an Image

Oh good - not just me then!

Just before I popped back - I used this "repeat scroll center top;" which has given me the tile of the bg as in your image - so next annoying question - why the annoying edge between each tile?

And will I be able to get my #wrap back or will I have to start from scratch?
  #7  
Old 07-20-2009, 06:55 AM
CharlesClarkson's Avatar
CharlesClarkson CharlesClarkson is offline
Community Moderator
 
Join Date: Feb 2009
Location: Stephenville, TX, USA
Posts: 11,356
Default Re: How to Change the Background to an Image

Quote:
Originally Posted by adew
Quote:
ADE - I also tried changing the hex to transparent but this didn't do anything either. Sooo, I'm obviously not destined to be a WP stylist and will just stick to the basic colours - but would like my #wrap back if anyone knows how I can return it?
It's not #wrap. It's #content. #content inherits its background from body. Since body is now transparent, so is content.

And CSS kicks my a## too. :)
__________________
Charles "Rubeus Hagrid" Clarkson
StudioPress on Facebook

I'm not really a smart person. I just play one on the Internet.

Please use the HTML or PHP tags for pasting code.
Please make your links click-able: this_is_annoying.com
http://this_is_not_annoying.com.
  #8  
Old 07-20-2009, 06:59 AM
CharlesClarkson's Avatar
CharlesClarkson CharlesClarkson is offline
Community Moderator
 
Join Date: Feb 2009
Location: Stephenville, TX, USA
Posts: 11,356
Default Re: How to Change the Background to an Image

Quote:
Originally Posted by NikkiB74
I put the piece of javascript in my header.php and it wiped out the whole header and turned my #wrap white too (I previously had this set to a light green #dfffe0).
Actually, it turned almost all your container backgrounds to transparent, so you could see what was behind them. In my test, there was a tartan stripe down the middle.


HTH,
__________________
Charles "Rubeus Hagrid" Clarkson
StudioPress on Facebook

I'm not really a smart person. I just play one on the Internet.

Please use the HTML or PHP tags for pasting code.
Please make your links click-able: this_is_annoying.com
http://this_is_not_annoying.com.
  #9  
Old 07-20-2009, 07:01 AM
adew adew is offline
Community Moderator
 
Join Date: Oct 2008
Location: Genève, Suisse
Posts: 14,270
Default Re: How to Change the Background to an Image

That edge is in the image itself. Looks like there's a 1px white border all the way round. You can trim this in photoshop.
__________________
Ade
Themessence - Studiograsshopper

WordPress plugins: Dynamic Content Gallery | Reveal Page Templates | Custom Taxonomies Menu Widget

Check out the Genesis and Child Theme tutorials before posting your question - and please provide YOUR URL!
Make Andrea happy - read her Firebug tutorial and save yourself loads of time and effort.
  #10  
Old 07-20-2009, 07:25 AM
NikkiB74 NikkiB74 is offline
Registered User
Pro Plus Member
 
Join Date: Jul 2009
Posts: 39
Default Re: How to Change the Background to an Image

Quote:
Originally Posted by CharlesClarkson
It's not #wrap. It's #content. #content inherits its background from body. Since body is now transparent, so is content.
This is where I changed the colour initially. I just meant the bit around the edges of the content (I think I can hear an audible sigh from here)

Quote:
#wrap {
background: #dfffe0;
width: 960px;
margin: 0px auto 0px;
padding: 0px;
}
Quote:
Originally Posted by CharlesClarkson
And CSS kicks my a## too. :)
Thnx makes me feel better

Thank you both for your patience and help - I shall go off and do some tweakage and try and figure this out. The image doesn't have a 1px outline when I open it but is somehow getting one through the process of 'saving' it. Another little obstacle to figure out.

I will get there......
  #11  
Old 07-20-2009, 07:47 AM
adew adew is offline
Community Moderator
 
Join Date: Oct 2008
Location: Genève, Suisse
Posts: 14,270
Default Re: How to Change the Background to an Image

Here's a cropped version:
[attachment=0:192u03sa]bg_new.gif[/attachment:192u03sa]
__________________
Ade
Themessence - Studiograsshopper

WordPress plugins: Dynamic Content Gallery | Reveal Page Templates | Custom Taxonomies Menu Widget

Check out the Genesis and Child Theme tutorials before posting your question - and please provide YOUR URL!
Make Andrea happy - read her Firebug tutorial and save yourself loads of time and effort.
  #12  
Old 07-20-2009, 08:10 AM
NikkiB74 NikkiB74 is offline
Registered User
Pro Plus Member
 
Join Date: Jul 2009
Posts: 39
Default Re: How to Change the Background to an Image

S'ok - I re-upped it directly rather than editing via Gimp and the edge went on it's own - but thank you.

I have managed to get it sorted - so I'm well pleased! I couldn't have done it without the help and bouncing ideas around. It made me go off and check stuff out and find an answer. So I learnt some stuff!

Thanks to all - i'll be back with an equally irritating question later :D
  #13  
Old 07-20-2009, 08:12 AM
adew adew is offline
Community Moderator
 
Join Date: Oct 2008
Location: Genève, Suisse
Posts: 14,270
Default Re: How to Change the Background to an Image

8-)
__________________
Ade
Themessence - Studiograsshopper

WordPress plugins: Dynamic Content Gallery | Reveal Page Templates | Custom Taxonomies Menu Widget

Check out the Genesis and Child Theme tutorials before posting your question - and please provide YOUR URL!
Make Andrea happy - read her Firebug tutorial and save yourself loads of time and effort.
  #14  
Old 10-05-2012, 11:34 AM
tasha_ikon tasha_ikon is offline
Registered User
Genesis Member
 
Join Date: Jan 2012
Location: Hampshire, England
Posts: 1
Default Help with site

Hi am reading this page with a huge amount of intrest, trying to work out why i can not change my background.

My site is not published yet, and I am trying to change the background in landscape child theme, running off genesis - and I am a TOTAL wordpress beginner!!

I don't understand what hex means, and am really working hard to understand the changes I have to make at the moment.

I am not sure if anyone will be able to see my site at the moment - but I know I have to up a link in.....

http://www.d1203050-18381.cp.blacknight.com/

Please if you can advise I would be so happy!

Thanks
Tasha
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Change Background To An Image? Smart Movez General Discussion 1 02-04-2009 11:51 PM


All times are GMT -5. The time now is 03:22 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.