Site logo

Archived topic

Sticky widget problem

3 replies · Started by fellows2020 on May 11, 2021

Viewing posts 1–4 of 4

Hi GeneratePress,

I attempted to make the last widget in my right sidebar sticky, using the code below from the GP support forum. I am using a custom sidebars plugin that allows different sidebars to be inserted depending on the category. The sticky sidebar appears to work for posts in one category (see this page: https://www.modernfellows.com/cheapest-prescription-eyeglasses/), but not for posts in another category (see this page: https://www.modernfellows.com/sustainable-fashion-brands/)

Can you suggest a fix? Thank you.

/* GeneratePress Sticky Sidebar */

@media (min-width: 769px) {
.site-content {
display: flex;
}

.inside-right-sidebar {
height: 100%;
}

.inside-right-sidebar aside:last-child {
position: -webkit-sticky;
position: sticky;
top: 60px; /*Adjust position */
}
}

Hi there,

In your CSS - try changing:

.inside-right-sidebar {
    height: 100%;
}

to:

.inside-right-sidebar {
    min-height: 100%;
}

That plugin is forcing the height of the sidebar to be a height of auto ... that should get around that.

Thank you for the fix. It works.

Glad to hear that

This archived topic is closed to new replies.