Archived topic
Global container - PageLayout
9 replies · Started by cpalo on January 11, 2021
Good evening
When we make the default choice container / one content (and not separate containers).
Does the theme automatically insert a global container that will encompass everything that will be inserted with generateblocks.
Or should we preferably when creating a page choose containers for what we will determine to be different sections ..
Hi there,
I'm afraid it's not what you thought it was :)
Here's a video to help you understand the differences between one container and separate containers options.
https://www.youtube.com/watch?v=zE8t7VGu2g0&t=61s
You can set a global container width at Customizing > Layout >Container > Container width for your whole site.
When you creating a GB container, choose "Contained width" for the Container, then the Container will respect the global container width you set in customizer.
Let me know if there's anything unclear.
No no I understood the difference.
But I wanted to know if choosing a global container causes GB to automatically insert an html tag just after the body to create this global container?
Thanks for the video... it's very good
Hi there,
no setting the container does not wrap the content after the Body tag.
All of the content you add to the Editor is output to the: inside-article container with the #page element.
Do you want to add around all of the sites content? IF so try adding this PHP snippet:
add_action('wp_body_open', function() {
?>
<div class="body-wrapper">
<?php
});
add_action('generate_after_footer', function() {
?>
</div>
<?php
});
It will open the <div> immediately after the opening <body> element, and close it after the footer
Adding PHP: https://docs.generatepress.com/article/adding-php/
Hi there,
no setting the container does not wrap the content after the Body tag.
All of the content you add to the Editor is output to the: inside-article container with the #page element.
Do you want to add around all of the sites content? IF so try adding this PHP snippet:
add_action('wp_body_open', function() {
?>
<div class="body-wrapper">
<?php
});
add_action('generate_after_footer', function() {
?>
</div>
<?php
});
It will open the <div> immediately after the opening <body> element, and close it after the footer
Adding PHP: https://docs.generatepress.com/article/adding-php/
Between one container and separate containers options, I wanted to know which Html Tags GB inserted according to the chosen option.
And if I understood correctly, in both cases this tag is inserted after inside-article.
All content is inserted within the inside-container whether use One or Separate Containers.
Neither option will affect the post content.
Those options simply change the design styles of the theme elements.
One Container the customizer Spacing and Background colors is applied to #content div.
Separate Containers those styles are moved to the inner container of each element eg. Posts content, Sidebar Widgets.
OK. Thanks
You're welcome