How to make last widget sticky in GeneratePress without plugin

In this article we will look at how to make the last widget sticky in GeneratePress theme without plugin.

Having the last widget sticky on your blog can help you a lot in making your user stay on your Website longer. And it’s really easy to do it, you don’t need any plugin or don’t even need to buy GeneratePress Pro.

Sticky sidebar widgets makes the websites more engaging by improving user-experience and improves click-though rate which decreases bounce rate of users. So why not have it on your WordPress site.

In this article we will learn how to make the last widget in the sidebar sticky. You can even scroll down this page and see the last widget is sticky.

Make last widget sticky in GeneratePress

It is really simple to make the last widget sticky in GeneratePress. Or any other WordPress theme, because we are going to user WordPress customizer feature which all themes support, weather it be Astra, Kadence or the one we are talking about here GeneratePress.

The only change is the CSS code which we are going to use here to make the Sitebar widget sticky.

Also Read: How to backup your WordPress site

Lets see how to make the last widget Sticky, just follow the steps below

  1. In your WordPress admin go to customizer by going to Appearance and then Customize.
blank
  1. Once you are on the customizer page in the Left Sidebar, look for additional CSS it might be at the end of all the options in the left side bar.
  2. Once you find it then click it. You will get an option to add CSS code in it. So copy the code written below and paste it in that input.
blank
CSS code to make last widget in sidebar sticky
@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: 20px; /*Change this according to your liking */
}
}

Once you have added the code and adjusted the top according to your need. Just click publish.

That’s it you have a sticky widget in your Sidebar to improve engagement of your website.

How sticky widget improves user engagement

So it is simple, if you have a long blog post or a long page then when the user scrolls down then the sidebar will look empty. What making a widget sticky is it utilizes the white space.

And it shows more options for your users to explore on your website.

Lets see how you can utilize the Sticky Sidebar widget

  • Showing Featured posts.
  • Showing ads.
  • Newsletter box.
  • Social Share options.
  • Social Follow options.
  • Any offer you are promoting.
  • Any new update you have.
  • Or any thing else you want every user visiting your site to know.

Final Thoughts

So in my opinion making your sidebar sticky is really important as it improves user engagement and it and it is fairly simple too.

Do write in the comments if you use any other method as it will be useful for others.

So at last i would like to thank you for following me though this tutorial on how to make last widget sticky in GeneratePress without plugin.

Leave a Reply