• Resolved oldjake

    (@oldjake)


    I thought I was pretty good with CSS, etc, but this is really got me.

    On the linked page, there is a white space above the orange banner. I can’t for the lif of me get rid of it. I want to use the Twenty Twenty Three theme to keep everything as simple as possible. I’ve tried a few other themes but I just end up with a billion plugins that all want money to be any use.

    Any help in getting rid of that white bar would be much appreciated!

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

Viewing 10 replies - 1 through 10 (of 10 total)
  • This may not be the “correct” way, but I added this to my child theme’s style.css:

    .wp-site-blocks {
      padding-top: 0;
      padding-bottom: 0;
    }

    If you don’t want the bottom padding, just remove it. If you aren’t using a child theme, you can add this to your ‘Additional CSS’ section. If you don’t see the ‘Customize’ section, you can just add /wp-admin/customize.php to your domain.

    Hi @oldjake this space can be removed in the Site Editor, kindly go to Appearance > Editor and open your page template. Once there click the Styles icon > Layout as shown in this screenshot and change the top and bottom padding to 0.

    To get to the Layout options, go to into the Editor, select Styles in the top right, and in the styles panel you should see:

    • Typography
    • Colors
    • Layout

    Click Layout to open the panel, and you should see the main content dimensions controls, including the content width, the main content padding controls, and the default block gap setting.

    You can click “unlink sides” on the padding control to open up separate controls for top, right, bottom, left.

    Here you would enter “0” for the top & bottom padding, and this will be applied to the?wp-site-blocks?container, and remove the space from above the header and below the footer.

    Here is a short video https://d.pr/v/HGeqiE

    Thanks for that tip, @thelmachido!

    Moderator Kathryn Presner

    (@zoonini)

    @oldjake Let us know if you got this all sorted.

    Thread Starter oldjake

    (@oldjake)

    Ah! Apologies for the delay. I only got one notification to say that I’d had a reply.

    I *did* sort it, but by installing a different theme and ignoring all the additional bits that they suggested.

    I *did* sort it, but by installing a different theme and ignoring all the additional bits that they suggested.

    Ok! I am going to mark this thread as resolved ??

    @thelmachido

    Thank you for that – it’s hard to remember exactly where to find each setting.

    Приветствую!

    корень данной проблемы лежит в файле wp-includes/class-wp-theme-json.php

    в этом файле есть запись:

    “$css .= ‘.wp-site-blocks { padding-top:”

    и этому свойству назначается параметр имеющий значение по умолчанию.

    С моей точки зрения, сама идея того что свойству корневого блока может быть присвоено в качестве значения по умолчанию что-либо отличное от нуля, является ошибочной.

    Если пользователю надо – он сам добавит столько отступов, сколько надо. Но не иметь возможности удалить отступ (почти в любом случае, пустое место над шапкой сайта выглядит несуразно.) без того чтобы искать какие-то обходные пути, копаться в коде, и т.д. – это плохой подход.

    Лично я, просто ставлю в этом файле значением по умолчанию “0” для отступов, без того чтобы перегружать сайт излишними и ненужными плагинами, навешиванием избыточных дополнительных стилей и прочего.

    и да, @thelmachido, твое решение не работает. оно не касается корневых блоков, а только унаследованных от корневых блоков.

    Thank you for sharing your thoughts @evilcreant. I agree that it would make more sense to set the top-padding to zero and let users add their own padding if needed, rather than setting the default to something else. That being said, this is also a design decision on the part of the theme author.

    Thanks @thelmachido !

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘wp-site-blocks’ is closed to new replies.