Archived topic
How to Make the last widget on sidebar sticky or scrolls down with the page?
7 replies · Started by Peter Paul on September 14, 2020
Hi GP Team,
I recently added an ad banner on my side bar.
Currently there are 5 elements on the side bar.
The 300x600 ad banner is the last element, and this ad only appears on posts and pages.
How can I make that ad banner sticky or the last widget sticky, or scrolls down together with the page?
This way the ad banner remains visible even if the user scrolls down to the bottom of the post/page.
Kindly let me know.
Thanks,
Hi there,
can you provide a link to your site so i can take a look at what CSS is required.
Link on "private information"
Note: the sidebar ad will only appear on posts / articles. It's hidden on front page.
Thanks!
try this CSS:
@media(min-width: 1024px) {
.site-content {
display: flex;
}
.inside-right-sidebar {
height: 100%;
}
.inside-right-sidebar .widget:last-of-type {
position: sticky;
position: -webkit-sticky;
top: 60px;
}
}
It worked! :)
Thank you very much! (b^_^)b
You're welcome
Hii David, Please take a look at my website. I want to make the sidebar sticky too on all of my posts.
https://thehighonmarketing.com
Do you only want the last widget in the right sidebar sticky as well?
If you want something different, please open a new topic.
Thanks!