Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Adding Global Banner

  • dillonloomis13

    Hi there,

    Me again, but this time I’m trying to add a Global Banner. I was able to make it as far as creating a new element, making it a Hook, putting it “before_header” but one, how can I make it full width so it stretches across the whole top of the page and no interfere with my current menu? And two, how can I adjust the height of the container so it’s taking up so much space? I’ll drop two images below of what I have currently and what I’m aiming for:

    Currently on my site: https://imgur.com/a/6KygQ2l
    What I’m aiming for: https://imgur.com/a/UErOcl4

    Thank you so much for your help!

  • Hi there,

    how can I make it full width so it stretches across the whole top of the page and no interfere with my current menu?

    The area of before_header is full width, so anything added to that hook should be full width by default.

    Can I see your site?

  • dillonloomis13

    Hi Ying,

    Thank you for the quick response. I will share the page in the private information section.

  • For the width issue, you have set the container’s max-width, so remove that along with margin-left and margin-right.

    And you are using a header element to merge the header with content, the before_header hook also fall into that category, so it also merges with the content.

    Do you only want the header to be merged with the content? Not the top bar?

    Let me know 🙂

  • dillonloomis13

    Okay, so I set the container BLOCK ALIGNMENT as “Default”, went to Spacing, and saw that the margins both left and right were set to “auto,” so I deleted that. But now the height is still very big, and now aligned to be in the top left?

    I guess I’m confused about what the difference between the header and the top bar is, but basically, I want it to look like this image below, where it says “Get Your Free Ranking Roadmap.”

    https://imgur.com/a/4DNqvsw

    So I guess I would like this banner to be above the menu, and not merge when scrolling? But if it does appear when scrolling down that is fine. I hope that gives a clearer idea on what I’m trying to do.

  • Did you remove the max-width too?

    Based on the screenshot, you do NOT need to merge header with content, so go to appearance > elements, and set the header element’s status to draft.

  • dillonloomis13

    Okay max-width has been removed.

    I had a element named “Home Page Header Empty for GB” that I changed to draft. Is there anything else that needs to be done? The height is still way to big for my liking, if I adjust the size of the font will that fix the issue?

    And also now, my header navigation looks off. There is a grey box around the header menu options. Can I go back to where it was transparent before? Something like this without the overlay of text: https://imgur.com/a/tR5EYkK.

  • The height is still way to big for my liking, if I adjust the size of the font will that fix the issue?

    It’s because the wp forms is tall, do you know how to adjust the height of the form?
    https://app.screencast.com/0pUPewIOIYWKm

    Reducing font-size of the headline won’t change the height of the container.

    For the menu color, as you removed the header element, so the color set for primary navigation in customizer is working.

    If you want the homepage’s site header merge with the content, and have another color for primary nav, then add this CSS:

    .home .site-header {
        position: absolute;
        left: 0;
        right: 0;
    }
    
    .main-navigation:not(.is_stuck) {
        background-color: transparent;
    }
    
    .main-navigation:not(.is_stuck) .inside-navigation .menu-item a {
        color: var(--contrast);
    }
  • dillonloomis13

    Got it. In the WP Forms, there’s a Advanced -> Form CSS Class field. And I found this article: https://wpforms.com/developers/how-to-provide-a-flexible-height-to-the-layout-field/

    And tried implementing these two codes separetely, but that didn’t seem to do anything:
    .wpforms-field-textarea textarea {
    height: 120px;
    min-height: 120px;
    max-height: 400px;
    }

    .wpforms-field.wpforms-field-textarea {
    height: 100px;
    }

    Also tried adjusting the second css code to 10px.

    As for adding the color CSS, where am I to add this?

  • As for adding the color CSS, where am I to add this?

    Customizer > additional CSS.

    The form CSS you found is targeting textarea kind of input, while you do not have that kind of input in your form. It’s a lot more complicated to adjust its position and height. Give this CSS a try:

    .wpforms-container .wpforms-field {
        display: flex;
        align-items: center;
    }
    .wpforms-container .wpforms-field input {
        flex-grow: 1;
        max-width: unset !important;
    }
    .wpforms-container label.wpforms-field-label {
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    div.wpforms-container-full:not(:empty) {
        margin-block: 0;
    }
  • dillonloomis13

    That didn’t seem to work either… I just copied and pasted: https://imgur.com/a/JB2foLK

    Here’s what the code looks like when I add it: https://imgur.com/a/2vCYfxZ
    Here’s what the site looks like: https://imgur.com/a/2vCYfxZ

    Overall I’m getting the assumption that this won’t work because the form height is too big… Are there any other solutions you can think of? I originally used a block from the library and just added a form.

  • I just copied and pasted: https://imgur.com/a/JB2foLK

    That’s for CSS class, not CSS code, add my code to customizer > additional CSS.

    Here’s what the code looks like when I add it: https://imgur.com/a/2vCYfxZ
    Here’s what the site looks like: https://imgur.com/a/2vCYfxZ

    The two images are identical. Can you check?

  • dillonloomis13

    So that seemed to work once I put that code into Additional CSS; it made the height shorter, but what element of the code do I edit to make the code height even smaller? I have not published it as yet.

  • I have not published it as yet.

    PLease publish it so we can see.

  • dillonloomis13

    Okay it is published. Please let me know how I can adjust the height. I also just moved the “Home Page Header Empty for GB” to draft so it doesn’t merge, but I would prefer to have this published because it looks much better.

  • 1. Add this CSS as well (those CSS should be provided by the form plugin’s support, not us)

    form#wpforms-form-1865 {
        display: flex;
    }
    
    div#wpforms-1865-field_0-container, div#wpforms-1865-field_1-container {
        padding-block: 0;
    }
    
    .wpforms-submit-container {
        margin-top: 0 !important;
    }

    2. Reduce the top and bottom padding of the root container of the topbar.

    3. Reduce the headline’s font-size.

Viewing 16 posts - 1 through 16 (of 26 total)
  • You must be logged in to reply to this topic.