• Resolved tobyj

    (@tobyj)


    Hi everyone,

    I am having trouble with customizing the way-too-big header image on my homepage (as it seems are many others…).
    Method 1:
    I can use the following code to shrink it to half-size, which is about what I want:
    /*change homepage image height */
    .twentyseventeen-front-page.has-header-image .custom-header-media,
    .twentyseventeen-front-page.has-header-video .custom-header-media,
    .home.blog.has-header-image .custom-header-media,
    .home.blog.has-header-video .custom-header-media {
    from-bottom;
    height: 50vh;}
    /* last line changes to half-size */

    However, this takes the top half of the image, which if you look at our page, you’ll see is not very interesting as the boy and river are on the bottom. Anyone know a line of code to throw in here that will tell it to crop from the top rather than from the bottom?

    Method 2: I can make the homepage image work by manually editing the image to have the boy/river on top and white space below (so that the image is large enough to fit in the theme still). However, that then messes up the header on other pages where WP is taking a strip from the middle of the large image – it will either be half white space or just the bottom of the boy. Is it possible to modify which part of the large image WP takes that excerpt of the image from?

    Thanks,
    Toby

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You can’t crop from the top. Instead you need to manually move the image upwards. In the “Additional CSS” section of the dashboard add this and play around with the percentage:

    
    
    @media screen and (min-width: 480px) {
        .has-header-image .custom-header-media img, 
        .has-header-video .custom-header-media video, 
        .has-header-video .custom-header-media iframe, 
        .has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-media img {
            top: -50%;
        }
    }
    

    https://codex.www.ads-software.com/CSS#Custom_CSS_in_WordPress

    • This reply was modified 6 years, 8 months ago by Andrew Nevins.
    Thread Starter tobyj

    (@tobyj)

    Awesome, that will definitely work. Thanks very much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Header Image Issues’ is closed to new replies.