and like us on FB

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:

■ ■ ■

  • Display the Total Number of Scheduled, Draft, or Published Posts (or by Author) with WordPress ShortcodeJune 24, 2017
  • Simple Expanding Blind WordPress ShortcodeJune 25, 2017
  • Mobile Design Considerations with WordPress and PHPJune 25, 2017
  • Convert Bitcoin Currency in WordPress with the Blockchain APIJune 26, 2017
  • Display Random Posts in WordPressJune 27, 2017
  • Dynamic Day Countdown with WordPress Shortcode or PHPJune 27, 2017
  • Human Readable Time Difference With PHPJune 28, 2017
  • Count Facebook Page Likes with WordPress Shortcode or PHPJune 28, 2017
  • Find and Replace Words in a WordPress PostJune 30, 2017
  • Static Day Countdown with WordPress Shortcode or PHPJuly 1, 2017
  • Create a Series Reading List with WordPress ShortcodeJuly 2, 2017
  • Obfuscate Email Addresses in WordPress with ShortcodeJuly 3, 2017
  • Check For A Spam IP Address With PHPJuly 4, 2017
  • Redirect a WordPress Image Page or Other Post Type to the Parent PostJuly 5, 2017
  • Create a Related Reading List with WordPress ShortcodeJuly 10, 2017

■ ■ ■

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.

■ ■ ■

  • Display the Total Number of Scheduled, Draft, or Published Posts (or by Author) with WordPress Shortcode24th June 2017, 12:05PM

    A number of years ago I published a that would publish the total number of…

  • Simple Expanding Blind WordPress Shortcode25th June 2017, 2:10AM

    This old code was literally a 5-minute fix to a problem a friend was having…

  • Mobile Design Considerations with WordPress and PHP25th June 2017, 5:10PM

    In another (“How Important is Your Mobile Optimised Website?”) we looked at numerous issues associated…

■ ■ ■

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.

Coming soon on BeliefMedia
  • Display the Total Number of Scheduled, Draft, or Published Posts (or by Author) with WordPress Shortcode24th June 2017, 12:05PM
  • Simple Expanding Blind WordPress Shortcode25th June 2017, 2:10AM
  • Mobile Design Considerations with WordPress and PHP25th June 2017, 5:10PM
  • Convert Bitcoin Currency in WordPress with the Blockchain API26th June 2017, 6:15AM
  • Display Random Posts in WordPress27th June 2017, 8:00AM

Our next 5 scheduled articles. See them all here.

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

By default all authors are returned. To include only specific users, list their IDs in a comma delimited list (id="1,2,5"). To remove authors, prefix their ID with a minus sign (id="-4,-6").

category

T list only specific categories, list them as such: category="1,4,7" To exclude a category, prefix the category with a minus sign.

orderby

The orderby list is quite extensive and is listed on the WordPress codex website . The primary means of ordering is by date (default).

order

The order list designates the ascending or descending order of the list. Either ASC or DESC.

format

The format applies to the fomatting of the returned date. Review options on WP Codex or the PHP Manual .

description

The description applies to excerpt. False by default, use description="1" to display excerpt text.

remove

If you choose to use the description, you can remove certain text (usually applies to tweet text and such that are injected into your post content).

words

Refers to the number of words returned in the excerpt. The teaser is 15 words by default… you don’t want to give too much away.

number

The number of posts to return. Returns all scheduled articles by default.

headingstyle

The heading style. Bold by default.

datestyle

The style applied to the date. Font size is 0.9em by default.

textstyle

The style applied to the description (excerpt) text. Font size is 0.9em by default.

cache

The period to cache your result. Defaults to 4 hours.

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
Description: Displays future scheduled posts in a WordPress posts or page with shortcode.
Download: Shortcode (V0.2) | WP Plugin (V0.2) | | Plugin Page

Shortt URL for this post: http://shor.tt/35ZS