[Resolved] Container Padding and Elements using Hooks

Home Forums Support [Resolved] Container Padding and Elements using Hooks

Home Forums Support Container Padding and Elements using Hooks

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1484225
    Matt

    Hi Guys,

    I’m using GP3 and Generate Blocks to build out a Woocommerce Site. I am wanting to use the Elements “Block” to create a full-width banner that sits below the main site header. My page is setup very much like your hooks documentation (ie. secondary nav -> main header section w/ logo -> primary nav -> content) – https://docs.generatepress.com/wp-content/uploads/2018/07/hooks-staticpage.png

    I have removed all padding from all containers in the “element” that i have created and am adding it to the ‘generate_after_header’ hook. However, there is still spacing around the image when viewed in the front end. This spacing can be removed by adjusting the content padding (https://docs.generatepress.com/article/content-padding/) but this isn’t ideal as it removes the content padding from all pages in the site.

    I would have thought the ‘generate_after_header’ hook would have placed this element before the content container and not in it, as it seems that the ‘generate_inside_container’ hook is designed for that. Am I missing something here or is that as intended?

    Any tips on how to achieve the result I’m after… which is a header element that can be conditionally attached to any page/ archive/ category archive etc and display at full width?

    Thanks

    #1484574
    David
    Staff
    Customer Support

    Hi there,

    can you share a link to your site where i can see the padding issue?

    #1484601
    Matt

    Hi David,

    Thanks for your response. The site is currently only in local dev and I just re-added the content padding (Customise > Layout > Container > Content Padding) to double check and there is now no padding around my heading. This leads me to believe that there was some caching going on in chrome. Sorry.

    Thanks

    #1484790
    David
    Staff
    Customer Support

    Glad to hear you got it resolved.

    #1749325
    Andrew

    Hello,

    I’m having a similar issue, but I’ve cleared my cache and that hasn’t seemed to resolve it.

    I’m trying to add an element (affiliate disclosure) after my header. However, on both desktop and mobile, there’s extra padding after the element (and before the breadcrumbs and main content).

    I’ve tried adjusting the padding within the affiliate disclosure element, but the space below it remains too big and doesn’t change at all with the adjustments.

    Thank you!
    Andrew

    #1749338
    Matt

    Hey Andrew,

    It looks like you have an empty text block below your affiliate container (right click and ‘inspect’ the space).

    Log in to admin > Appearance > Elements > ‘Affiliate Container’ Block. Click the space below your block and use backspace to remove it.

    This has got me plenty of times ๐Ÿ™‚ Hope it is the fix you are after.

    #1749351
    David
    Staff
    Customer Support

    Thanks Matt for answering – that indeed looks like the issue ๐Ÿ™‚

    #1749390
    Andrew

    That was it. Thank you so much!

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