[Resolved] How to make Last Widget Sticky without plugin?

Home Forums Support How to make Last Widget Sticky without plugin?

  • This topic has 9 replies, 2 voices, and was last updated 2 months ago by David.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1091527
    Suraj Katwal

    I have found something like this code for Genesis Theme to make last widget sticky.

    /* Last widget Sticky*/
    @media only screen and (min-width: 1024px) {
        .content-sidebar-wrap {
            display: -webkit-box;
            display: -ms-flexbox;
            display: flex;
            -webkit-box-pack: justify;
            -ms-flex-pack: justify;
            justify-content: space-between;
        }
    
        .sidebar-primary .widget:last-child {
            position: -webkit-sticky;
            position: sticky;
            top: 60px;
        }
    
        .admin-bar .sidebar-primary .widget:last-child {
            top: 72px;
        }
    }

    Is there any way like this to make last widget sticky in GP
    Thanks.

    SEO, WordPress Optimization, Blogging Tutorials.
    GeneratePress Tutorial: https://www.wplogout.com

    #1091561
    David
    Staff
    Customer Support

    Hi there,

    can you share a link to your site so i can take a look at the CSS required?

    #1091568
    Suraj Katwal

    Currently, I am developing my site in offline mode. Thank you.

    SEO, WordPress Optimization, Blogging Tutorials.
    GeneratePress Tutorial: https://www.wplogout.com

    #1091588
    David
    Staff
    Customer Support

    Try this CSS it applies to the right side bar:

    @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: 80px; /* Adjust to suit position */
        }
    }
    #1091592
    Suraj Katwal

    Thank You. It is working.

    SEO, WordPress Optimization, Blogging Tutorials.
    GeneratePress Tutorial: https://www.wplogout.com

    #1091782
    David
    Staff
    Customer Support
    #1366381
    Marcel

    The only problem is the widget will overflow the footer. How to solve this?
    Screen recording here.

    #1366482
    David
    Staff
    Customer Support

    Try applying some margin-bottom to the .inside-right-sidebar aside:last-child CSS.
    If still an issue – start a new topic where you can share you site and we will take a look.

    #1366494
    Marcel

    For the moment I found another solution : I made the widget background transparent. It’s a trick but it works. Thank you.

    #1367497
    David
    Staff
    Customer Support

    Aah – thats a good idea. Glad to hear you found a solution

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