How to Create and Style a Sticky Post in WordPress

WordPress offers hundreds of features and functionalities to it’s users. And most of the users are not aware of all these functionalities. I, myself don’t know all of them. But the more I am using WordPress, the more I am learning.

Just in case you don’t know, there is a built-in option in WordPress to create a sticky post. Here on this post I will write on how you can make a sticky post in WordPress and style it to make it stand out.

Before moving to that, let’s see why you should use Sticky Post function. BY using this

  • You can stick any important post for your readers.
  • You can promote any offers/Afiliate programs
  • It gets more attention.

How to Create a Sticky Post in WordPress

Creating a sticky post is very easy and simple. You don’t need any plugin or other coding to do that. This is built into WordPress. You can find this option under “Visibility” section in the “Publish” box.

Click on ‘Edit’ where you see “Visibility: Public“. You’ll see several options. Check the box where it says “Stick this post to the front page”. Follow the image below.

Create Sticky Post

After checking this, Click on OK. Now when you’ll publish your post this post will be on top of all posts in Homepage. Next, let’s see how you can style this a bit.

Also Read : Create a Sticky Sidebar Widget That Scrolls With You!

How to Style Sticky Post in WordPress

You must do some styling to make your Sticky Post stand out. This is quite easy to do.

Open the style.css file of your theme and add the below code anywhere in that file.

.sticky {background: #edf8ff; border: 2px solid #d5dbe2;}

Here we gave the sticky post an unique background and a border so that it looks different from other  posts.

This code will result into this –

Stciky Post

The one with a light blue background is the sticky post and the white one is a normal post.

However, if you know a little bit of CSS you can change the code according to your needs or to match the colors with your blog. You can also use a background image instead of a color.

Note : You might not see the changes immediately. Clear your cache to see the changes.

That’s it! Now go and create some sticky posts. Let us know through comments if you face any difficulties while doing this. Also don’t forget to subscribe to our updates using the form below.

5 responses to “How to Create and Style a Sticky Post in WordPress”

  1. Yogananda Reddy Avatar
    Yogananda Reddy

    Hi Imtiaz Rayhan,

    i am not get it can u help me

    1. Istiak Rayhan Avatar
      Istiak Rayhan

      Yes, I will help you out. What is the thing about this post you are not understanding?

      1. Yogananda Reddy Avatar
        Yogananda Reddy

        when i paste the above code in css it not shows result thats my problem plz help me

        1. Istiak Rayhan Avatar
          Istiak Rayhan

          Maybe, this is a theme related issue. If you are using a Premium theme, contact with your theme provider.

  2. Raplus Avatar
    Raplus

    Hey Imtiaz Rayhan,

    I thought we have to change many things to create sticky post. I didn’t think that this is a very easy work as you have mentioned. Thanks bro :-)

Leave a Reply

Your email address will not be published. Required fields are marked *