Subscribe to receive my FREE email course to help you improve your blog design and grow your audience with actionable exercises that do not require a designer or developer!
WordPress Sticky Posts is a feature places a post at the top of the front page of posts, keeping it there even after new posts are published. If you have a specific blog post that you want to feature more predominately, you can mark the post as sticky. This feature is particularly useful if you have a theme that does not have a specific call out section above the fold.
When should you use sticky posts?
If you have a post that you want to drive more traffic to compared to other more recently published posts, you can make it sticky. For example, if you have a sponsored post, giveaway, or particularly viral post, making it sticky will push it to the top of your blog feed on your website. Since most website visitors do not scroll down, a sticky post is a great way to drive as much traffic to a specific post as possible.
How often should you use sticky posts?
Sticky posts should only be used for one or two posts on the blog unless the theme design requires it to be used more frequently. It should not be used for every post. When you uncheck the Sticky option, the post moves back to its place in chronological order.
How do you make sticky posts in WordPress?
The individual post editor method is ideal for individual posts you want to make sticky one at a time.
- In your WordPress dashboard, go into the individual post edit page.
- In the Publish toggle, select Edit next to the Visibility field.
- Select Stick this post to the front page.
- Press Update or Publish when you are ready to save your changes.
The quick edit method works best if you want to make a group of published posts sticky at the same time.
- In your WordPress dashboard, go to All Posts under the Posts tab.
- Select the checkbox next to the post you want to make sticky.
- In the Bulk Actions drop-down, select Edit. Press Apply.
- A new toggle will open. Off to the right, you will see Sticky drop-down selection. Select Sticky.
- Press Update. The selected posts are now sticky.
You can also watch this video tutorial to show you both methods:
How to style sticky posts?
It’s very easy to style sticky posts, and the options are endless, really. Most themes use post_class() function to add automatic post classes to each post. When you mark your post sticky, a “sticky” class will be added to your post, like this:
<article id="post-12" class="post-12 post type-post sticky hentry">
If your theme is not adding the sticky class to the post container, you can add it yourself by adding the post_class() function to a div or article container. In the specific php file, it will look something like this:
<article id="post-<?php the_ID(); ?>"<?php post_class(); ?>>
You can then add whatever css styling or formatting that you want to add.
How can you hide sticky posts from the WordPress loop?
By default, WordPress displays your sticky post at the top of all of your WordPress posts but also where it is located chronologically. If the post you make sticky is showing up twice on your homepage, you want to avoid that (poor user experience and SEO). Using the ignore_sticky_posts argument, you can avoid this situation:
<?php $args = array( 'posts_per_page' => 10, // or whatever number of posts you want to show per page. 'ignore_sticky_posts' => 1 ); $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
Do you have any questions about WordPress Sticky Posts? I’d love to hear your feedback! If you are interested in learning more about WordPress, make sure to subscribe to my WordPress newsletter here!