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.