Site logo

Archived topic

How did you set 30px left and right on GP website

7 replies · Started by Adrien on March 6, 2022

Viewing posts 1–8 of 8

Hello,

While inspecting GP website CSS, I could not find out how did you set 30px left and right margins on GP website.

On my website, I have to manually set it up for each container.

How did you do that on GP Website? Did you use a Global style container in which you've set right and left margin at 30px?

Thank you for your guidance.

Thank you David. What did you use on GeneratePress Website to have the 30px right and left margins on all pages?
Global style container with 30px right and left margins or did you use a filter in functions.php?

Do you mean Margins or Padding ? As i am not sure what you mean.....

I'm sorry Padding my mistake. For instance on GP website :

.gb-container-4e0857f5>.gb-inside-container {
padding: 0 30px;
}

How was this set up? Global style or filter?

Well probably when we built the site it was all done manually, back then Container Blocks had a default of 40px padding.
Today you would use the filters provided here:

https://community.generateblocks.com/t/using-global-styles-by-default/74

For example you could use this:

add_filter( 'generateblocks_defaults', function( $defaults ) {
    $defaults['container']['paddingRight'] = '30';
    $defaults['container']['paddingLeft'] = '30';
    
    return $defaults;
} );

So this will make it so any new Container Block will have 30px left and right padding.

Amazing! Thanks a lot David. I learnt new stuff today ;-)

Glad to hear that!!

This archived topic is closed to new replies.