• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Header image height

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Header image height

This topic is: resolved

Tagged: header, header image, header image height

  • This topic has 5 replies, 2 voices, and was last updated 9 years, 7 months ago by andym119.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • February 14, 2014 at 12:38 pm #90323
    andym119
    Member

    If I upload a header image for a blog at a height of 250px, I have to put the following in the css for the full height to show on the blog:
    .site-header { height:250px;}

    However, I will not be putting a site-header height in the css as I am designing a multisite and I would like users to upload a header of any height and then for it to show automatically that height on their blog

    I checked this on the wordpress twentyfourteen theme and it works like this by default, but not sure how to get the header to work like this on Genesis.

    February 14, 2014 at 1:39 pm #90332
    Stefsull
    Member

    How are you inserting the image for the header? Is it an actual image sitting inside the <header class="site-header" ... or is it a background-image?

    If it's a background-image, it isn't possible to have the header that contains it react to its size. If it's an image in your HTML/DOM, do you have a link where we can view the issue?

    February 14, 2014 at 3:14 pm #90353
    andym119
    Member

    I'm developing my website locally.
    If I create a genesis child theme and make no edits to it except the basics, I just go to admin/appearance/header to upload and insert the header image. The difference that I noticed between twentyfourteen and Genesis is when you right click and inspect element in the wordpress twentyfourteen theme, the header image is in the html as an image, so I can see why the height shows as it is.

    But by inspecting the header image on Genesis, the image is not sitting inside the <header class=”site-header,
    it appears in the right styles tab - (index):19 and says:

    .custom-header .site-header {
    background: url(my-web-url-for-header-image) no-repeat !important;
    }

    So I am not sure if there is any alternative solutions to get the Genesis header to work the same as the twentyfourteen theme where the height of the header will be displayed as the height it was inserted as. Otherwise I will need to install a custom css plugin and ask users to change the site-header height in the css to reflect the header image they inserted.

    February 14, 2014 at 4:25 pm #90370
    Stefsull
    Member

    Right. Since it's a background image, you'll have to use min-height: your-height-px ...

    I imagine the reasoning is because the Genesis theme is responsive. And responsiveness is much easier to achieve with a background-image (plus, you can serve retina images through your media queries as well as serving a much smaller image to mobile devices).

    There might be a way to change whether Genesis inserts it as a background or foreground image, via hooks or something. But it might affect your layout. I dunno.

    February 15, 2014 at 2:02 pm #90526
    andym119
    Member

    Good point, I'll use min-height. I'm still trying to figure it out but starting to think it can't be done as I would like. I saw a similar question on another forum but doesn't seem there is a solution for it. Nevertheless, I'll keep this topic unresolved for while.

    February 19, 2014 at 3:30 am #91104
    andym119
    Member

    I have just worked out a solution to do this. It also allows users to select the height of the header, link the header image back to my homepage and allows the image to respond in ratio as the screen gets smaller which saves me asking other questions on the forum 🙂

    I'll keep this as a reference if anyone wants to do the same.

    I removed the header theme support and registered a new widget area and hooked it in genesis_header. I then installed a plugin called image widget, moved the image widget in the new widget area and I can now have any height show automatically (the whole image will show so the height depends on the width and width-height ratio) and add a link for it. This header image is also now an img tag in the html and so responds bit by bit in ratio as the screen gets smaller like the other images do which I much prefer.

    The site title and description now appears above the header image but you can reposition or remove with css.

    The header is now perfect for my site, does anyone see any issues with this setup ?

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble