Default GenerateBlock container padding
When inserting a GenerateBlocks container, a default padding of 40px is being applied by default.
Here is one of Tom’s gist to set your own default paddings. You can add the code to your functions.php of your child theme or through a functionality plugin.
add_filter( 'generateblocks_defaults', function( $defaults ) { $defaults['container']['paddingTop'] = ''; $defaults['container']['paddingRight'] = ''; $defaults['container']['paddingBottom'] = ''; $defaults['container']['paddingLeft'] = ''; return $defaults; } );
The above example applies no values to the container paddings. Of course, you can apply your own values between the single quotation marks (=”).
Thank you for your trick 🙂
But it doesn’t work in my GeneratePress site with GenerateBlocks.
In which funktion.php do I have to insert the code?
I have one in wp-content/themes/generatepress
another in wp-content/plugins/generateblocks/includes
and another in wp-conten/plugins/generateblocks-pro/includes
Thanks,
Bettina
Hi Bettina. The functions.php file is always located inside your theme folder. It’s better to use a child theme for this approach and edit your child theme’s functions.php instead otherwise, any future theme updates would override that file. To install a GeneratePress child theme follow this guide.