Archived topic
sticky sidebars
37 replies · Started by Kris on July 13, 2020
Hi, I know new features are always coming out. Checking to see if sticky sidebars is available? So when the user scrolls the sidebars stay visible?
Let me know, always the best support! Kris
Hi there,
Unfortunately we have no plan to add an option for sticky sidebars - there isn't enough demand.
Is there a page where the sidebar can be seen?
We can try some CSS.
Here's the a blog post where the sidebars can be seen: https://www.littledotbigdifference.com/books/
Thought it would be cool if the sidebar dots followed along with the reader.
But most of my readers are on a mobile, so not that big of a deal.
If it's a lot of work on your end to provide the CSS, don't worry about it.
Thank you! Kris
Hi there,
try adding this CSS:
@media(min-width: 769px) {
.both-sidebars .site-content {
display: flex;
}
#left-sidebar, #primary, #right-sidebar {
left: unset;
}
#left-sidebar {
order: -1;
}
.inside-left-sidebar, .inside-right-sidebar {
position: -webkit-sticky;
position: sticky;
top: 100px;
}
}
Oh my gosh, works!! Amazing. Thank you. Your support and platform continue to blow me away, for YEARS!! Have the best day, Kris
Glad we could be of help
WOW guys! Thank you SOOOO much for this! I've been grappling with trying to do this for literally 2 years now (off and on of course, lol). It never ceases to amaze me how awesome you guys all are! LOVE GP!
Awesome! Glad the topic helped :)
Ya this is amazing. Finally allows me to remove this plugin: WP Sticky Sidebar
- I actually feel it would be a good check on/off function in customizer, with one field for "padding from the top".
Thanks guys!
Rylan, I totally agree! Hopefully Tom agrees and gives us a little Christmas gift this year. ;)
Not sure if its worth the amount of extra code that the Customizer would need in order to generate what is a few lines of CSS. Especially if we consider that sometimes a user wants to change the breakpoint for sidebars.
If you're using GP 3.0 with the Flexbox Structure you now only need this:
/* Stick sidebars */
@media(min-width: 769px) {
/* stick right sidebar */
.inside-right-sidebar,
.inside-left-sidebar {
position: -webkit-sticky;
position: sticky;
top: 60px;
}
}
And if you want to just stick the last widget in the sidebars you can do this:
/* Stick last widgets in sidebars */
@media(min-width: 769px) {
.inside-right-sidebar,
.inside-left-sidebar {
height: 100%;
}
.inside-right-sidebar .widget:last-child,
.inside-left-sidebar .widget:last-child {
position: -webkit-sticky;
position: sticky;
top: 60px;
}
}
As always you guys are amazing! You always go above and beyond. Thank you so much!
Glad we cab be of help!
Wouawww this is precious! Thank you David.
Glad you found it useful