Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
1  
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 Salsas 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 Salsas Aug 29 '13 at 15:24
show 1 more comment

1 Answer

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 Salsas Aug 30 '13 at 9:37
add comment

Your Answer

 
discard

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.