How to Create Last Widget Sticky in GeneratePress Theme?

In this tutorial, we are going to create last widget sticky in GeneratePress Theme using the plugin and without the plugin.

The sidebar is one of the essential parts of the blog. Using different widgets in the sidebar can make your website engaging. The sidebar helps to increase the Click Through Rate (CTR) of the website.

Here we are going to learn to create the last widget sticky like in my WordPress blog. You can scroll down this blog post and check the right sidebar.

We are going to use two methods to make widgets sticky in GeneratePress Theme.

  1. Creating the last widget Sticky Using Plugin.
  2. Creating the last widget Sticky Without Plugin.
How to Create Last Widget Sticky in GeneratePress Theme

In WordPress, we can use a floating or Sticky widget in many ways. If you have longer blog posts then without a sticky widget your right sidebar will be blank while scrolling the post. so it’s better to have the floating widget.

Moreover, you can use the sticky widget on your site for the following purposes.

  • Show Popular Posts.
  • Display Featured Posts.
  • Embed Chat Box.
  • Embed Subscriber Widget.
  • Display Affiliate Banner.
  • Show Recent Posts.
  • Social Sharing Icons.
  • Advertisement Box.
  • Coupon Codes.
  • Stick or Float any widgets.

Create Last Widget Sticky in GeneratePress using Plugin

Fixed Widget plugin is a popular and widely used technique to make your sidebar sticky. For this, you need to install the Q2W3 Fixed Widget plugin. You can use the Q2w3 WordPress plugin in other WordPress Themes too.

Let’s install and implement it in GeneratePress Theme.

Fixed Widget Option in Widgets
  • Go to Plugins > Add New
  • Search Q2W3 Fixed Widget Plugin.
  • Install and Activate it.
  • Go to Appearance > Widgets.
  • Go to the Right Sidebar.
  • Choose the last widget and you will see Fixed Widget Option.
  • Check the Fixed Widget Option to create Sticky. (Follow the above Screenshot)
  • Hit Save Button.
  • Also, Go to Appearance > Fixed Widget Options
  • Adjust the Widget settings according to your theme needs.
General Options in Q2W3 Fixed Widget

Also Read: Add Google Analytics to GeneratePress Theme

Create Last Widget Sticky in GeneratePress without Plugin

Making Last Widget Sticky is easy in GeneratePress using the CSS code. It is a lightweight approach and a small CSS code works like a charm.

Let’s make the last widget sticky using CSS code in GeneratePress Theme. Note that the code is for the blog with the right sidebar. Adjust the code if you are using the left sidebar.

Last Widget Sticky Code for GeneratePress Theme
  • Go to Appearance > Customize > Additional CSS.
  • Copy and Paste the CSS code.
  • Adjust the value in top CSS property if required.
  • Hit Publish Button.
@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: 70px; /*Adjust position */
  }
}

Check Out: Display Related Posts in GeneratePress Theme

Conclusion

so which method are you going to try?

If you are unfamiliar with the code then you can use the Q2W3 Fixed Widget plugin. There are plenty of plugins besides Q2W3 in the WP repository to create a sticky widget and you can try any of them and let me know in the comment section.

Personally, I have used CSS Code in my WPLogout blog as you can check the last widget in the right sidebar.

In the end, I would like to thank you for reading the whole tutorial to create last widget sticky in GeneratePress theme.

Resources used in this post

Share:

I am obsessed with WordPress and write articles about WordPress Speed Optimization, SEO, and Blogging. I mostly publish tutorials on GeneratePress, Astra, Kadence, and GenerateBlocks.

37 thoughts on “How to Create Last Widget Sticky in GeneratePress Theme?”

  1. I have tried multiple classes and IDs to try and get this to work with the theme I use called Accesspress Store. Are you able to activate it and see if you can give it a shot

    Reply
    • Hi Viney, I haven’t tried the code for the last 2 widgets but you can look for :nth-last-child selector and adjust the code. Also, there is a plugin option to fulfill your requirement.
      Thanks

      Reply
  2. I have tried This CSS on My website QzLyrics.com Buy the last item on widget is not sticky. I have used this css on simple css plugin.  I do not want to use any third party plugin. Thank you

    Reply
    • Hi Bijay,
      If you are using responsive AdSense code in the widget then it won’t work.
      Please try adding fixed size Ads code, it will work.
      Thanks

      Reply
  3. Hello.
    I would like to make last widgets sticky on both left and right hand side bars.
    The right-hand sidebar is working perfectly. How do I implement it for the left hand side bar?

    Reply
    • Hi Palla,
      Just Inspect the CSS for the left sidebar and change the code in the inside-right-sidebar to the left sidebar CSS code.
      I hope it will work, let me know after trying.
      Thanks

      Reply
  4. With this method, can I add a Sticky Adsense ad on my blog? Since sticky ads are not permitted for mobile can I hide them on mobile and just show them on desktop? Will, there is any Adsense violation, let me know.

    Reply
  5. If you are using left and right sidebars in GP then use below CSS
    “`
    @media (min-width: 769px) {
    #right-sidebar .inside-right-sidebar { height: 100%; }

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

    #left-sidebar .inside-left-sidebar { height: 100%; }

    #left-sidebar .inside-left-sidebar aside:last-child {
    position: -webkit-sticky;
    position: sticky;
    top: 30px; /*Adjust position */
    left: 0;
    }
    }
    “`

    Reply
  6. Sir if by using this css widget will be stiky but if i paste adsense conde into this wideget then sticky is not working tell me why

    Reply

Leave a Comment