If you‘re using WordPress to run any kind of website beyond a simple blog, chances are you‘re leveraging custom post types. In fact, a survey of WordPress sites found that over 50% use custom post types to better structure and display different types of content.
However, by default, the sticky post functionality in WordPress only works for standard posts. This means that key content published as custom post types doesn‘t get the visibility boost of being stuck to the top of archive pages.
The good news? With a few simple steps, you can enable sticky functionality for custom post types and start strategically featuring your most valuable content. In this guide, we‘ll walk you through the process and share tips for making the most of sticky custom posts.
Why You Should Be Using Sticky Posts for Your Custom Content
Before we dive into the how-to, let‘s talk about why you‘d want to make custom post types sticky in the first place. If you‘re not familiar, "sticky" posts are posts that are fixed to the top of your blog or archive pages, regardless of publish date.
This prime positioning makes sticky posts stand out and allows you to showcase important content. Some common use cases for sticky posts include:
π¨ Timely announcements: Got an upcoming event, limited-time sale, or important update? Make it a sticky post to ensure visitors don‘t miss it.
π Best content: Use sticky posts to surface your highest-performing or most valuable content, like popular guides, case studies, or resources.
π Fresh finds: Featuring new content in a sticky post can give it an initial boost and help it gain traction.
πΊοΈ Navigation aids: Sticky posts can act as guideposts, helping direct visitors to key areas or resources on your site.
But here‘s the thing: these use cases aren‘t limited to just standard WordPress posts. Custom post types β like products, services, portfolio pieces, courses, etc. β can benefit just as much (if not more!) from being stickied.
For example, let‘s say you run an ecommerce site selling outdoor gear. You could make your highest-performing products sticky in your shop archive, or feature seasonal best-sellers. Or maybe you‘re a web designer showcasing your work with a portfolio custom post type β sticking your most impressive projects could help you land more clients.
The bottom line is that if you‘re putting time and effort into creating custom post type content, you want that content to get seen. Sticky posts are a simple but powerful way to control what shows up "above the fold" on your archive pages and guide visitors‘ attention to the right places.
How to Enable Sticky Functionality for WordPress Custom Post Types
Sold on the benefits of sticky custom posts? Great! Let‘s walk through how to actually set them up on your WordPress site.
Step 1: Install & activate the "Sticky Posts β Switch" plugin
While WordPress allows you to make regular posts sticky out of the box, custom post types don‘t have this functionality by default. To enable it, you‘ll need help from a plugin.
We recommend using the free Sticky Posts β Switch plugin. It‘s lightweight, regularly updated, and makes it easy to choose which custom post types you want to make sticky-able.
In your WordPress dashboard, go to Plugins > Add New and search for "Sticky Posts β Switch". Click "Install Now" and then "Activate".
Step 2: Configure the plugin settings
Once activated, click on the new "Sticky Posts β Switch" item in your WordPress admin menu. This will take you to the plugin‘s settings page.
Here, you‘ll see a list of all the custom post types on your site, with checkboxes to enable or disable the sticky functionality for each one. Check the box next to each post type you want to be able to make sticky. For this example, let‘s say we want to enable sticky posts for a "Products" custom post type.
[Screenshot of plugin settings page with "Products" post type checked]Click the "Save" button to confirm your settings.
Step 3: Mark individual custom posts as sticky
Now that you‘ve enabled sticky functionality for your chosen custom post types, you can designate individual posts as sticky or not.
Go to the main admin screen for your custom post type (e.g. Products > All Products). You‘ll notice a new "Sticky" column has been added to the posts table, showing a pushpin icon for each post.
To make a post sticky, simply click the pushpin icon next to its name. The pin will turn red, indicating that the post is now stuck to the top of its respective archive page. You can unstick a post at any time by clicking the pin again.
Pro tip: You can also switch a post between sticky and unsticky from the main post editing screen, using the "Sticky" checkbox in the "Publish" meta box.
Step 4: Create a custom archive template (optional)
At this point, your sticky custom posts should automatically be displaying at the top of their respective archive pages. However, this only works if your theme‘s archive template is set up to display sticky posts.
If you‘re seeing your sticky posts in the wrong order, or not showing up at the top, you may need to create a custom archive template. Here‘s how:
Create a new file in your theme (or child theme) folder named
archive-{posttype}.php, replacing{posttype}with the slug of your custom post type. For example,archive-products.php.Copy the contents of your theme‘s existing
archive.phpfile into this new file. This will be your starting point for customizing the custom post type archive display.Find the main post loop in the template (it will look something like this):
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
// Post content here
<?php endwhile; else : ?>
// No posts found message
<?php endif; ?>- Just before the loop, add the following code to check for sticky posts and display them first:
<?php
$sticky_products = get_option( ‘sticky_posts‘ );
if ( is_array( $sticky_products ) && ! empty( $sticky_products ) ) {
$args = array(
‘post_type‘ => ‘products‘,
‘post__in‘ => $sticky_products,
‘posts_per_page‘ => -1
);
$sticky_query = new WP_Query( $args );
while ( $sticky_query->have_posts() ) : $sticky_query->the_post();
?>
// Sticky post content here
<?php
endwhile;
wp_reset_postdata();
}
?>This code snippet first retrieves the IDs of all sticky posts for the "products" post type (change this to match your post type slug). It then sets up a new query to fetch just the sticky posts and display them before the main loop.
- Inside the
whileloop for the sticky posts, you can display the post content just like you would in the main loop. For example:
<article id="post-<?php the_ID(); ?>" <?php post_class(‘sticky‘); ?>>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
</article>Notice the addition of the sticky class to the post article β this will allow you to style sticky posts differently if desired.
- Save your custom archive template and test it out! Your sticky custom posts should now be displaying before the rest of the posts in the archive.
Step 5: Style your sticky posts (optional)
If you want your sticky posts to really stand out visually, you can use CSS to style them differently from regular posts. The sticky class added to the post article makes this easy.
For example, to give sticky posts a contrasting background color and bold title, you could add the following to your theme‘s stylesheet:
.sticky {
background: #f7f7f7;
padding: 2rem;
border: 1px solid #ddd;
}
.sticky h2 a {
font-weight: bold;
}Feel free to get creative and style your sticky posts in a way that makes sense for your site‘s design and content.
Tips for Using Sticky Custom Posts Strategically
Now that you know how to create sticky custom posts in WordPress, let‘s talk about how to use them for maximum impact. Here are some tips:
1. Be selective
It can be tempting to make every new custom post sticky, but resist that urge. Sticky posts are most effective when used sparingly and intentionally. Only stick the posts that are truly deserving of that extra attention.
A good rule of thumb is to aim for no more than 1-3 sticky posts per custom post type archive at a time. This ensures your sticky content gets the spotlight without overwhelming the rest of the archive.
2. Make it obvious
Sticky posts only work if visitors realize they‘re, well, sticky. In addition to visually styling sticky posts, consider adding a label like "Featured", "Popular", or "Editor‘s Pick" to clue readers in.
You could do this by adding a custom field to your custom post type and display it with a conditional like:
<?php if (get_field(‘is_featured‘)) echo ‘<span class="featured-label">Featured</span>‘; ?>3. Prioritize evergreen content
One of the most effective ways to use sticky posts is to feature your best evergreen content. These are the resources that provide ongoing value to your audience, regardless of when they were published.
Some examples might include:
- π§° Ultimate guides or tutorials
- π Original research or data
- π Customer success stories or case studies
- π§© Foundational pages (About, Contact, Resources)
By sticking this type of content, you can keep driving traffic to your most impactful assets.
4. Rotate regularly
Just like with any type of featured content, it‘s a good idea to switch up your sticky posts on a regular basis. Aim to review and update your sticky posts at least once a month to keep things fresh.
Consider creating a schedule or setting a reminder to ensure this task doesn‘t fall by the wayside. Regular rotation not only keeps your archive pages feeling dynamic, but also gives more of your posts a chance to shine.
5. Track performance
Finally, don‘t forget to measure the impact of your sticky posts and adjust your approach based on the data. Some metrics to keep an eye on include:
- Pageviews: Are your sticky posts getting more views than the average post?
- Engagement: Are visitors spending more time on your sticky posts or interacting with them more (comments, shares, etc.)?
- Conversions: If your sticky post has a specific conversion goal (email signups, product purchases, etc.), is it performing better than other posts?
Use Google Analytics or your preferred analytics tool to track these metrics and see what‘s resonating with your audience. Let the data guide your sticky post strategy.
Go Forth and Get Sticky!
Whew, that was a lot of information! Let‘s recap the key points:
- Sticky posts are a powerful way to feature important content at the top of your archive pages
- By default, WordPress only allows regular posts to be sticky β but a simple plugin lets you enable sticky functionality for custom post types too
- Once set up, you can make any custom post sticky or unsticky from the post edit screen
- Use sticky posts sparingly and strategically for maximum impact
- Track performance to see what‘s working and tweak your approach accordingly
If you‘ve made it this far, you‘re well on your way to mastering the art of the sticky custom post. It may seem like a small thing, but trust me β this one tweak can make a big difference in how visitors engage with your site.
So what are you waiting for? Go forth and get sticky! π
Further Reading & Resources
Want to dive even deeper into the world of sticky posts and custom post types? Check out these additional resources:
- The Ultimate Guide to WordPress Custom Post Types
- How to Create a Custom Post Type in WordPress (Step by Step)
- How to Organize WordPress Custom Post Types with Taxonomies
- How to Display Custom Post Types on Your Homepage in WordPress
Happy optimizing!
