WordPress allows you to create the sticky post in your site, which will always stick at the top of your blog page. So, if you would like to know more on the sticky post feature in WordPress, then, let’s move ahead to lean about the sticky post in WordPress.
What is sticky post in WordPress?
So, what is actually sticky post in WordPress? As already stated, it is the post in your site, which will always stick at the top of your blog page, to make that post always featured for your site. Also, you can design this post uniquely in your site to display it differently as from the normal post.
Also, you do not have any limitation at all about how much sticky post can be added in your site. If you need it, you just go and create it. You can do that unlimited times in your site.
Now, the latest question may arise within your, ie, is it possible to make the posts sticky in the category pages? Well, the answer to it is no, you can’t make posts sticky in the category pages of your site out of the box.
How to create sticky post in your site?
Now, since you have learned about what is sticky post in WordPress, now you may want to know about how to apply the same in your site, right? Well then, why the wait on the same, let’s move ahead and manage the same for your site too.
This feature is only available to the WordPress default post type, ie, posts from which you create the posts in your site. So, let’s create the post in your site and add this sticky post feature within that post.
Now, after you have entered, ie, you are in the post creation/editing page, there you will see about Publish section in the right corner in post editor section. There, you have the option of Visibility, from which you can manage the same.
Here, in the above screenshot, you can see we have already set the sticky post for that post in our site by, clicking on the Visibility section on same and then, adding the checkmark on the checkbox option of Stick this post to the front page option. Now, after you have done the same as we did then, you can just publish/update the very post and this feature will get locked in into that post of your site.
Output of the sticky post for your site
Now, as we already stated that the sticky post can be styled differently for your site so, let’s move ahead and style it differently for the same.
WordPress creates/adds additional post class for the posts added in your site, which are saved as sticky, which is
.sticky. So, you can style those via this class for your site too as an example below:
border: 1px solid #4629e1;
From the above CSS code, you can see the output of that CSS code to the sticky post as below:
Here, above you can see that the first post, ie, sticky post is displayed at the top of blog page always and is styled differently than the other normal posts just below that post. You can also notice that the sticky post have the published date earlier than the new post added up in your site.
You may also want to read:
- Add And Display Featured Image In WordPress
- Tutorial On Creating WordPress Child Theme
- How To Display First Paragraph Only Added In Your Posts Via WordPress
If you have successfully followed this tutorial and have became successfully able to create sticky post in your site then, we can assume that you are now more familiar on this than before. But, if you are still confused about how to do it and want more help on this then do drop the comment below in the comment box and we will follow it up.