Archived topic
Single Post width when you use GP with Elementor
3 replies · Started by Erika on February 15, 2021
When you use an Elementor template to single posts together with GeneratePress, you might encounter the problem that the width of the single post template gets set to full width.
Why? GeneratePress has a global max-width value set to "auto." embedded into the theme files. This value is overwritten when you set a container size from the Customize -> Layout. The new value is added to the theme elements via inline-style to the page index. When a template from Elementor is applied, the new value has no container to be added to.
The solutions is (at the moment) to add the code
selector #page {
max-width: 1400px; [or whatever the site-width]
}
Add this code in Elementor -> Template -> Select and Open Single Post Template -> Settings of the Template -> Advanced -> Own CSS
In this case this CSS is added to the single post template and gets loaded only when a single post ist loaded.
I hope it helps others, too.
Hi there,
thanks for sharing your fix.
This problem occurs because of a 'fix' that Elementor introduced many years ago .... you can see an issue related to that 'fix' was raised on GitHub here:
https://github.com/elementor/elementor/issues/5636
Maybe Elementor want to revisit that issue ...
Thanks, David, I am sharing it :)
You're welcome - and thank you again for sharing your workaround :)