Site logo

[Resolved] Floating sidebar

Home Forums Support [Resolved] Floating sidebar

Home Forums Support Floating sidebar

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2118585
    Maarten

    The question has probably been answered a million times already, but none of the previous answers seem to work on my site.
    I have a sidebar with two widgets. How can I make this sidebar sticky, so the visitor will still see the widgets if they scroll down?

    #2118627
    Ying
    Staff
    Customer Support

    Hi Maarten,

    Try this CSS:

    .inside-right-sidebar {
        position: sticky;
        top: 65px;
    }

    Feel free to adjust the value 65px to re-position the sticky sidebar.

    Adding CSS: https://docs.generatepress.com/article/adding-css/

    #2118635
    Rolf

    Hy Ying,
    it works, great !!

    Rolf

    #2118652
    Ying
    Staff
    Customer Support

    You are welcome 🙂

    #2181775
    Craig

    Thanks for sharing this. Is there a way to target only blog posts for the sticky sidebar? For example, when the sidebar moves on the Shop page, it can be kind of distracting especially if the page isn’t very long. Thanks.

    #2181796
    Fernando
    Customer Support

    Hi Craig,

    You can try modifying the CSS to something like:

    .single-post .inside-right-sidebar {
        position: sticky;
        top: 65px;
    }

    .single-post targets posts.

    Hope this helps! Kindly let us know how it goes. 🙂

    #2182749
    Craig

    Worked great. Thank you!

    #2184411
    Fernando
    Customer Support

    You’re welcome Craig! Glad to be of assistance! Feel free to reach out anytime you’ll need assistance with anything else. 🙂

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.