This article will show you how to include a list of posts in a series based on WordPress tags. An older version of this shortcode included both a series list and related list in the same function. However, because of the perceived attribute confusion and associated complexity we've sensibly split them into two.
A tag, not unlike a social hashtag, can often be unique to tie a specific sub-group of articles together. This article will tie these distinct hashtags into a reading list - not unlike an article split into chapters of a book.
Since we don't have any series posts (yet) we'll bundle all the posts tagged with wp_query
into a series (in reality the posts are better served by a related reading list). The shortcode of [series tags="108"]
returns the following:
- Display a List of Child Pages With WordPress Shortcode — May 28, 2017
- Display Future Scheduled Posts in WordPress — June 1, 2017
- Display the Total Number of Scheduled, Draft, or Published Posts (or by Author) with WordPress Shortcode — June 24, 2017
- Display Random Posts in WordPress — June 27, 2017
- Create a Series Reading List with WordPress Shortcode — July 2, 2017
- WordPress Post & Page Dropdown Menu — July 7, 2017
Scheduled (and unlinked) articles may be included in the list with an icon and text indicating their status. Shortcode of [series tags="108" status="publish,future"]
returns the following list. The screenshot was taken when most articles were scheduled and, as such, this article shows as both a future article and the current page.
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
While there are a quite a few attributes, very few are required other than tags
.
tags
tags
. While a comma-delimited list of tags is permitted, it's best-practice to only use a specific tags that will tie your content together.status
publish
. To include future posts (to give readers an indication of the rest of the scheduled series), use status="publish,future"
.image
image
value is empty, we'll use the HTML entity to render a clock (⏲).align
align
attribute is used to position the image defined above. Use it if the image doesn't center correctly.description
description="1"
.format
remove
remove="the text"
.words
words
by default. Alter it with words="25"
.number
number="1"
.headingstyle
headingstyle
is the default style applied to your post title. Defaults to font-weight: bold;
.datestyle
datestyle
is the default style applied to your post date. Defaults to font-size: 0.9em;
.textstyle
textstyle
is the default style applied to your post description (excerpt). Defaults to font-size: 0.9em;
.currentpagestyle
currentpagestyle
is the default style applied to the current page title. Defaults to text-decoration: none; font-weight: normal;
.cache
Considerations
- Using a textbox or some other means of formatting you can jazz up the result a little.
- Display a List of Child Pages With WordPress Shortcode — May 28, 2017
- Display Future Scheduled Posts in WordPress — June 1, 2017
- Display the Total Number of Scheduled, Draft, or Published Posts (or by Author) with WordPress Shortcode — June 24, 2017
- Display Random Posts in WordPress — June 27, 2017
- Create a Series Reading List with WordPress Shortcode — July 2, 2017
- WordPress Post & Page Dropdown Menu — July 7, 2017
- Our blind shortcode will hide the series until clicked. It won't result in the same page-view conversions, but it will clear up the clutter.
- Display a List of Child Pages With WordPress Shortcode — May 28, 2017
- Display Future Scheduled Posts in WordPress — June 1, 2017
- Display the Total Number of Scheduled, Draft, or Published Posts (or by Author) with WordPress Shortcode — June 24, 2017
- Display Random Posts in WordPress — June 27, 2017
- Create a Series Reading List with WordPress Shortcode — July 2, 2017
- WordPress Post & Page Dropdown Menu — July 7, 2017
- While the shortcode can be used to return any number and type of post, this isn't the intended use. Instead, we've built purpose shortcodes to reduce the complexity.
Download
Title: Create a Series Reading List (WP Plugin)
Description: Create a Series Reading List with WordPress Shortcode. Renders a WP series of posts based on tag.
Download • Version 0.2, 2.6K, zip, Category: WordPress Plugins (General)
WordPress Shortcodes, (1.9K)