Display or hide sticky posts

WordPress lets you mark posts as “sticky” so they appear at the top of listings, regardless of publish date.

You can prevent sticky posts from appearing at the top of Display Posts using:

[display-posts ignore_sticky_posts="true"]

This doesn’t actually exclude sticky posts, it just prevents them from appearing at the top.

Display sticky posts

After adding the code snippet at the bottom to your site, you can list only sticky posts using:

[display-posts id="sticky-posts"]

Exclude sticky posts

After adding the code snippet at the bottom to your site, you can exclude sticky posts using:

[display-posts exclude="sticky-posts"]

This code snippet goes in a core functionality plugin or Code Snippets.

Filters used:

Published by Bill Erickson

Bill Erickson is a freelance WordPress developer and a contributor to the Genesis framework. For the past 14 years he has worked with attorneys, publishers, corporations, and non-profits, building custom websites tailored to their needs and goals.

Join the Conversation

  1. I am trying your plugin but my sticky posts do not appear at the top. I tried this,
    ignore_sticky_posts=”false”
    but it had no effect.

    1. My guess is your theme or another plugin is altering how sticky posts work in queries on your site. You can use the Health Check plugin to see your site with all plugins deactivated and turn them on one-by-one to find the culprit.

Leave a comment

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