Archived topic
Sidebar Stack on on top of Content
6 replies · Started by Mark on January 16, 2017
Hi Tom,
Still rocking the GP theme!
Quick question, is it possible to stack the sidebar on top of the content. I know it is possible but wouldn't know how. Can you help? Cheers.
Hi Mark,
Are you wanting your sidebar to be between header/navigation and the content? for both all devices?
Checkout generate_after_header and generate_inside_container hooks.
http://demo.generatepress.com/hook-locations/
Hi Leo,
On a mobile device instead of the sidebar been below the content box I need it on top.
Thanks
Give this CSS a shot:
@media (max-width: 768px) {
.site-content {
display: table;
}
.site-main {
display: table-footer-group; float: none;
}
.sidebar {
display: table-header-group; float: none;
}
}
Adding CSS: https://docs.generatepress.com/article/adding-css/
You can also use the Flexbox method (will accomplish the same thing): https://generatepress.com/forums/topic/change-order-on-mobile/#post-157121
Thanks guys,
Tom's seems to work a little better than yours Leo. The padding or something seems to be off in yours. But again thanks for your help!
Glad we can help and thanks for the feedback :)