• Hi, just finishing off a wordpress site but having problems with the header image in Twenty thirteen. I have uploaded an image exactly 1600 × 230 pixels, as the dashboard suggests to be used as is, the problem is unless the website is viewed in full screen, the header image is cut off left and right. Using Firefox inspector I’ve worked out htis is because of…

    .site-header {
    background: url(‘http: //www.mountaincottageyurts.co.uk/temp/wp-content/uploads/2014/06/MCY-header.jpg’) no-repeat scroll center top / 1600px auto transparent;
    }

    …and the center part aligning the middle of the image. As the text in the image is to the left, I want to align the background image to the left. When I try this in the Firefox inspector it works as I want, but how do i change the code?? it’s not in the css, I’ve tried that and the inline:78 seems to override the style.css

    Any help is much appreciated , the url is http://www.mountaincottageyurts.co.uk/temp/home-2/

    Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • That site is not running the original 2013 theme. It is running a child theme. What happens if you upload the same header image in the unedited parent theme?

    Thread Starter dozzell

    (@dozzell)

    I’ve switched it over to the original twenty thirteen theme and uploaded the header image, the same thing happens (I’ll leave it like this if you want to take a look) As mentioned before, the alignmment seems to come in after the css – i’ve tried using the code…

    .site-header {
    background: url(‘http: //www.mountaincottageyurts.co.uk/temp/wp-content/uploads/2014/06/MCY-header.jpg’) no-repeat scroll left top / 1600px auto transparent;
    }

    …in the style.css but using the Firefox inspector it gets overridden by inline?

    Thanks for your help.

    I can’t see anything wrong with the site atm. Are you perhaps using a smaller screen to view the site?

    Thread Starter dozzell

    (@dozzell)

    Theres nothing wrong, it’s just the header image is aligned to the center and I want it aligned to the left.

    As twenty thriteen’s header image is not responsive, when the browser window is scaled smaller or larger, it affects how much of the header image is shown. As the image is currently set to center, it cuts off left and right pof the header image as the browser window is scaled.

    The text in my particular header image is on the left hand side, so if I can align the header image to the left rather than the center, it will just cut off the right side. Ive tested using the left command in the Firefox inspector and it has the desired effect, I just want to know how to code that in to the site,

    Thanks again.

    Hi dozzell
    I have the same issue you have: I have an header image I’d like to use in the 2013 template but I’d like to have it left aligned and not centered.
    Did you find a solution?
    My next idea is to search for a similar template with left aligned header image by design.. but not found yet.

    Thanks

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    @mallibus, You can create a new thread here: http://wordpress.org/support/theme/twentythirteen#postform

    If dozzell wants to help you he can visit your thread by going through your profile.

    You can always refer back to threads by linking to them.

    eh eh eh!
    I did it!
    I changed the file

    \wp-content\themes\twentythirteen\inc\custom-header.php

    in the function twentythirteen_admin_header_style()

    change the block

    <?php
    if ( ! empty( $header_image ) ) {
    echo ‘background: url(‘ . esc_url( $header_image ) . ‘) no-repeat scroll top; background-size: 1600px auto;’;
    } ?>

    into

    <?php
    if ( ! empty( $header_image ) ) {
    echo ‘background: url(‘ . esc_url( $header_image ) . ‘) no-repeat scroll left top; background-size: 1600px auto;’;
    } ?>

    (added “left” between “scroll” and “top”)
    Now the background image of the header is nicely left aligned!
    I cannot link the site because I am still working on my local machine, I have not yet this site on a host.

    Ciao!

    oops sorry Andrew I posted before reading your note!

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Twenty Thirteen header image alignment’ is closed to new replies.