Providing your readership with a list of scheduled posts is an effective means of cementing yourself in their minds. By giving them a sneak peak at your future content they are, anecdotally, more inclined to come back for more. This article will provide you with the necessary shortcode to render a list of scheduled posts. There are a few options that alter the way in which the information is presented.
This is a complete rewrite of a function that formerly resided on Internoetics (although it looks nothing like the old one). It's been rewritten to more closely align with WordPress best practice. Note: The little squares I've plastered on the screen are my own just to break up the page for readability.
The Result
For the first example, we'll print scheduled articles from all authors in all categories - ascending in date (most recent first). The shortcode of [future
will render the following list:
■ ■ ■
- No future posts scheduled yet.
■ ■ ■
If you're reading this at a point when there aren't any scheduled posts, the list will look as follows (the image link includes the excerpt text).
In the example above I've list all future scheduled posts. To limit the number to just the next three that are written by me I'll use [future number="3" author="1" description="0" format="jS F Y, g:iA"]
. I've enabled the short excerpt with description="1"
, and I've altered the format in which the date will be returned. The author="1"
is my WordPress user ID. The result.
■ ■ ■
- No future posts scheduled yet.
■ ■ ■
In the final examples we'll display the list in a narrow box to emulate what it might look like if styled in a sidebar.
- No future posts scheduled yet.
The full list of attributes that'll alter the appearance of your list are detailed below.
WordPress Shortcode
Copy and paste the WordPress function into your theme's functions.php
file or, if you sensibly have one installed, your custom functions plugin. You may optionally download and install our plugin from the bottom of of the page.
If you require shortcode to work in a sidebar widget, you'll have to enable the functionality with a filter. If you're using our custom functions plugin, you'll have that feature enabled by default.
Shortcode Attributes
author
id="1,2,5"
). To remove authors, prefix their ID with a minus sign (id="-4,-6"
).category
category="1,4,7"
To exclude a category, prefix the category with a minus sign.orderby
orderby
list is quite extensive and is listed on the WordPress codex website . The primary means of ordering is by date
(default).order
order
list designates the ascending or descending order of the list. Either ASC
or DESC
.format
format
applies to the fomatting of the returned date. Review options on WP Codex or the PHP Manual .description
description
applies to excerpt. False by default, use description="1"
to display excerpt text.remove
description
, you can remove
certain text (usually applies to tweet text and such that are injected into your post content).words
words
returned in the excerpt. The teaser is 15 words by default... you don't want to give too much away.number
number
of posts to return. Returns all scheduled articles by default.headingstyle
datestyle
textstyle
cache
Considerations
- The function will return any post types (published, drafts, etc) but we'll publish additional shortcodes designed specifically for that purpose to avoid unnecessary complexity.
- More on WP Query here .
Download
Title: Display Future Scheduled Posts in WordPress (WP Plugin)
Description: Displays future scheduled posts in a WordPress posts or page with shortcode.
Download • Version 0.2, 2.1K, zip, Category: WordPress Plugins (General)
WordPress Shortcodes, (1.4K)