Archived topic
How to set default inner container padding?
5 replies · Started by Michelle on March 4, 2022
I'm loving GeneratePress in general but am really struggling with how to set defaults for pages / containers / inner containers.
On this page: https://utw11145.utweb.utexas.edu/programs/veteran-spouse-resiliency-group-test/
I have the page 'Content Container' set to 'Full Width' on this page, and it works great - BUT, on narrower screen widths, the inner containers have no padding so the text pushes right up to the edges of the screen.
If I set the page 'Content Container' to 'Default', nothing goes Full width, even the containers that are set to Full Width and have background colors etc.
I don't want to have to edit every single container on every page to adjust inner padding for various screen sizes. I can set it in my child theme's custom CSS but it seems like it should just work? What am I doing wrong?
Hi Michelle,
The most "correct" way would be to add the padding to GB's containers.
If you add some values for the desktop view, it should inherit for tablet and mobile.
Let me know if this helps :)
But that would mean I have to add padding to every single container that I use site-wide, and if I decide to change the global padding I'd have to re-edit every single container.... what a colossal pain. I can't believe that's how all the sites running on GeneratePress do it.
Michelle, no you do not neet to do it on every page.
There is several ways you can deal with this.
One is customizer > layout > container alighnment = boxes
Other is Elements ... set you default container there
Or in the GB defaults like this (functions.php) https://github.com/thisbit/apuri/blob/master/themes/generatepress_child/inc/thisbit%40apuri_generateblocks.php
not knowing the specifics ... one of these methods will work.
Thanks Elvis! I'd love to look at that php in the functions.php file but that link to Github isn't working for me - can you resend? thanks!
Michelle, sorry I forgot that this one is a private github repo. :)
here is the list of all the options on toms github: https://github.com/tomusborne/generateblocks/blob/c2aad72f6868001c6f7fa9b606cafef511eebd1b/includes/defaults.php#L231-L243
and here are instuctions on how to do it
https://wordpress.org/support/topic/default-margins-for-containers/#post-13025697