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.

I am running twenty-twelve theme and have applied a header background on the .site-title class. Header shows up but it's width is only 960px.

How do I disable the left and right margins/padding of this theme so I can expand the picture to cover entire header area? ( I don't know what css code to add)

Here's a picture if it makes more sense: http://imgur.com/yBdPmRT

Thank you in advance!

share|improve this question
    
This is basic CSS and should probably not be in the WordPress section. Try finding out how to make a full-width header and use style.css in the Twenty Twelve theme to add the proper style. –  engelen Jun 28 at 11:03

1 Answer 1

up vote 0 down vote accepted

You will have to do a lot of modifications on this one.

We are going to modify header.php file

Firstly move this piece of code from header tag file to below body tag

 <?php if ( get_header_image() ) : ?>
    <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php header_image(); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a>
    <?php endif; ?>

wrap this code in a div

 <div class="header-full-width">
  <?php if ( get_header_image() ) : ?>
    <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php header_image(); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a>
    <?php endif; ?>
            </div>

Now add css

.header-full-width img {
 width: 100%;
}

This should do the trick.

share|improve this answer

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.