- This topic has 5 replies, 2 voices, and was last updated 4 years ago by
David.
-
AuthorPosts
-
March 29, 2019 at 5:48 am #853361
Maarten
I’m trying to have a centered primary content area all over my website, but add a right sidebar on certain pages while keeping the central content area the same (same width and centered).
I’ve tried almost everything (also in the beta 1.8), but can’t figure out how.
Closest I got is specifying a global width in the customizer that uses a width that’s suitable for sidebar/content/sidebar and then removing the sidebars and changing the width in a layout element where they aren’t needed (beta 1.8 function). However, this means I can’t use the sections function anymore to have a section background stretch the full screen.
Any suggestions?
GeneratePress 2.2.2GP Premium 1.7.8March 29, 2019 at 6:05 am #853381David
StaffCustomer SupportHi there,
can you link me to a page where the sidebar is active?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 29, 2019 at 6:16 am #853398Maarten
Hi David,
It isn’t, as I can’t get it to work. Not that I can’t activate the sidebars (see the test page below), I just can’t get the primary content to stay centered.
My container width now is 700px. If I activate a sidebar, this stays 700 of course (making the primary area smaller to add the sidebar, see test page). In the beta 1.8 I can specify a container width per layout element, but as this is a max-width it doesn’t widen it, but can only make the container smaller.
March 29, 2019 at 7:34 am #853564David
StaffCustomer SupportHmmm… try this:
@media (min-width: 1024px) { .right-sidebar .site-content { display: flex; } .right-sidebar .content-area { flex: 1 0 700px; } .right-sidebar .site.grid-container { max-width: 1300px; } .right-sidebar .site-content:before { content:'' !important; display: block; flex: 0 0 300px; } .right-sidebar #right-sidebar { flex: 0 0 300px; } }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 29, 2019 at 8:09 am #853584Maarten
My hero! ๐
Didn’t think of using the .right-sidebar class and flex myself, so thanks! I’ll probably add some for the tablet media query as well, but should be able to figure that out myself.
Thanks for the fast responses!
March 29, 2019 at 8:11 am #853587David
StaffCustomer SupportIts a bit overkill and i am sure it could be done with some left margin on the content area, but i think this is a little more flexible ๐
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.