- This topic has 11 replies, 4 voices, and was last updated 4 years, 10 months ago by David.
-
AuthorPosts
-
June 19, 2019 at 11:16 am #935013Sebastien
Hi,
Is there a Css class that I can use to be able to use (retrieve) the layout padding even when my content is under a
div position:absolute
or when my page is set :Content> Content Area > Full Width (no padding)
thanksJune 19, 2019 at 11:19 am #935022LeoStaffCustomer SupportHi there,
Any chance you can link us to the page in question?
I can provide the best suggestion that way.
Let me know ๐
June 19, 2019 at 11:34 am #935031SebastienThere is no page in question.
At the moment I use:Content> Content Area > Content (no padding)
I would like to be able to change into :Content> Content Area > Full Width (no padding)
but keeping the same padding that the previous situation.
I wished GP would provide a CSS class that store these params.June 19, 2019 at 11:43 am #935038LeoStaffCustomer SupportSorry I’m confused where you are seeing those settings.
Are you referring to these?
https://docs.generatepress.com/article/page-builder-container/June 19, 2019 at 12:00 pm #935053SebastienYes that’s it !
June 19, 2019 at 12:10 pm #935063LeoStaffCustomer SupportSo just to make sure, you want to add padding when full width option is selected?
If so try this CSS:
.full-width-content.separate-containers .inside-article, .full-width-content.one-container .site-content { padding: 20px; }
June 19, 2019 at 12:23 pm #935074SebastienNo,
I want to add the same padding withfull width (no padding)
‘s option selected than withcontent (no padding)
‘s option selected.
I don’t want to set manually the px of the padding. I wished I could use a CSS class using the padding param of the content layout already stored in GP.June 19, 2019 at 3:06 pm #935189TomLead DeveloperLead DeveloperHi there,
So you want to apply the padding values from the Customizer to the Full Width template?
If so, try this:
add_action( 'wp_enqueue_scripts', function() { if ( function_exists( 'generate_spacing_get_defaults' ) ) { $spacing_settings = wp_parse_args( get_option( 'generate_spacing_settings', array() ), generate_spacing_get_defaults() ); $padding = generate_padding_css( $spacing_settings['content_top'], $spacing_settings['content_right'], $spacing_settings['content_bottom'], $spacing_settings['content_left'] ); wp_add_inline_style( 'generate-style', '.full-width-content.separate-containers .inside-article, .full-width-content.one-container .site-content {padding:' . $padding . '}' ); } } );
Let me know ๐
June 19, 2019 at 11:40 pm #935413SebastienHi Tom,
that doesn’t work: the full width is still full width.
Maybe I miss explain my case: I’m not sure it is padding value… I’m trying to apply the margin that uses by grid-container.June 20, 2019 at 2:41 am #935546DavidStaffCustomer SupportHi there,
not sure i fully understand what you’re trying to do but for example if you have a Full Width page container and you wanted a DIV to keep the container width set in Customizer then you would add the
grid-container
class to it e.g<div class="grid-container"> <!-- my contained content markup goes here --> </div>
June 21, 2019 at 10:58 pm #937617SebastienHi mates,
Thanks David for explanations.
My issue still persistes because I try to add
grid-container
CSS class to a “Group” wp block.
But it s already automaticly own anotherClass > grid-container
calledalignfull
which forces full width..
Any other idea ?My aim is to be able to decide which block I need to be full width and which block I need to be with a “standard” layout width.
thanks
June 22, 2019 at 4:43 am #937733DavidStaffCustomer SupportSo are you looking to have the background of the block extend full width and keep the content contained?
-
AuthorPosts
- You must be logged in to reply to this topic.