WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I access to the css file where is the header's background image?

background: url("http://xxx.es") no-repeat scroll center top / 1600px auto transparent;

It's not in the style.css

share|improve this question
Browse through your theme folder. Or better yet, check that xxx.es URL full path and track it down. – Christine Cooper Aug 29 '13 at 14:23
Are you looking for the image file or the place where the CSS is created? – s_ha_dum Aug 29 '13 at 14:38
I'm looking for the css file. I want to make the background image responsive (increase or decrease according to the resolution). – Manolo Aug 29 '13 at 14:47
If you are using Chrome Developer Tools (or Firefox with Firebug) you can view the properties of the header using inspect element. Your matched CSS Rules will tell you the location of the file with that css. If it is your page itself, then it means the css is probably being generated through the functions.php file or the a theme php file. – Seth Alling Aug 29 '13 at 14:55
I've found it in custom-header.php (echo 'background: url(' . esc_url( $header_image ) . ') no-repeat scroll top; background-size: 1600px auto;';). Now, I can't do what I did with a <img> tag (max-width:100%; height:auto; width:auto\9; /*ie8*/). How can I do it with a background image? – Manolo Aug 29 '13 at 15:24

This is an inline CSS from source code, normally it's because there is somewhere in the theme options where you can upload an image for header and the code was written to process that case by inserting an inline CSS directly. If you already found that line of code in header.php then you can replace the $header_image with your own image. After that you can strip off the inline CSS, make a class for the header image and add the properties to the style.css file.

You can use code tag in your post when quoting codes so it's easier for us to read the code and help you further.

share|improve this answer
Thanks. I had already changed the custom-header.php. Removed the 1600px for image displaying and added a 100% width option. This way I could come back to my default configuration. – Manolo Aug 30 '13 at 9:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.