• Resolved billbennett

    (@billbennett)


    I’ve moved a site from an older theme to Twenty Twenty-Two. It’s been a learning experience, but hopefully a worthwhile one.

    There is one aspect of the new site editor I can’t get on top of. I’ve used a Header template part at the top of the page. It looks how I want it, but there’s a wide white margin between the top of the block and the top of the page.

    Can anyone tell me what is causing that space and how I can eliminate it? I’d like the Header template up hard against the top of the page.

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

Viewing 13 replies - 1 through 13 (of 13 total)
  • Hi! @billbennett!

    The site looks great :chef-kiss:

    I am not 100% sure where that top margin comes from. There should be a way to remove it via the block settings but it might be easier to just add the following CSS code:

    .wp-block-template-part {
      margin-top:0;
    }

    The Customizer is no longer available with Twenty Twenty-Two, You can use this plugin to add the custom CSS instead.

    Please do let me know if this helps!

    Thread Starter billbennett

    (@billbennett)

    That works perfectly, thanks.

    I couldn’t find the source of the top margin, but fixing it with CSS works.

    Hej @billbennett, would you be so kind to provide more additional information how have you used this css code?

    Thanks!

    Hey @goutm, you can add this custom CSS code by heading to this URL (replace “yoursite.com” with your site’s actual address):

    https://www.yoursite.com/wp-admin/customize.php

    Once you are there, you will want to look for a tab called “Additional CSS” and paste the CSS code there.

    Are you experiencing the exact same issue as @billbennett? If your issue is different, could you please open a new support thread? If the issue is the exact same, could you share a link to your site?

    Once you are there, you will want to look for a tab called “Additional CSS” and paste the CSS code there.

    Well, yes, I know where to add the additional CSS — but the code provided is CSS class, so you need to apply this class to the element you want, don’t you? That’s why I asked and also because I don’t know if my question is the same.

    I got an unknown padding between header and page content and an unknown padding between footer and bottom of the page. Please advise if I should start a separate tread?

    Thread Starter billbennett

    (@billbennett)

    I got there by using the plug-in Alvaro recommends, then the code. It works.

    Hi @goutm

    the code provided is CSS class, so you need to apply this class to the element you want, don’t you?

    The class wp-block-template-part is already built into the block editor, there is no need to add it to the HTML.

    That being said, I wrote the code above to fix the issue on @billbennett’s site and it may not necessarily work on your site. Do you have a link where we can see your site in order to confirm this?

    Thank you!

    Do you have a link where we can see your site in order to confirm this?

    Do you have a link where we can see your site in order to confirm this?

    Thank you! Yes, but today I faced a issue, that I need to fix first…
    https://www.ads-software.com/support/topic/latest-gutenberg-update-changed-my-site-template/

    So I will come back after either I fix it or restore my site from a backup.

    So I will come back after either I fix it or restore my site from a backup.

    Gotcha @goutm . Since this thread was opened by @billbennett and his issue has been fixed, I am going to mark it as solved.

    Please feel free to open a separate thread when you are ready. You can link back to this one if you think it would help.

    @mrfoxtalbot – this works for Twenty Twenty Three WordPress theme as well. Thank you very much!

    Hi guys I am on twenty-twenty-three and have margins affecting both Header and Footer, being the footer the worst in my case.

    I have already put two codes, first the one on https://wpastra.com/docs/how-to-stick-footer-to-bottom-when-page-content-is-less/

    #page {
        display: flex;
        flex-direction: column;
    	min-height: 100vh;
    }
    .admin-bar #page{
    	min-height: calc(100vh - 32px);
    }
    #page .site-content{
        flex-grow: 1;

    Than the one you indicated here:

    .wp-block-template-part {
    margin-top:0;
    margin-bottom:0;
    }

    All on the customize.php session.

    Also I deactivated all plugins, deleted scripts for GDPR pop up and chat button. Still get margins.

    On the layout editor I reduced padding and margins to zero.

    Here is the site: siriusconnect.app

    Can’t see where to remove it.

    Thanks a lot for the help.

    • This reply was modified 1 year, 4 months ago by deborahwp78.

    Hi @deborahwp78 it sounds like you managed to sort out the issue, I am glad if that is the case. If that isn’t I would suggest opening your own issue on the forums adding the issue you are having and a link to the comments you have made here.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Annoying white space above header template part’ is closed to new replies.