Plugin: In-Series

published

WordPress categories are great for grouping posts of a similar nature together, but creating a new (sub-)category every time you have a series of posts can be tedious. Sometimes you might not have enough posts in the series to justify a whole new category. Or perhaps each post in the series belongs in seperate categories. Various plugins exist to link posts together by various criteria; but no elegant solution existed to definitively link sequential posts in a series, regardless of when they were posted, or to which categories they belong. Until now!

In-Series provides an easy, future-proof way to connect a series of posts. If you have a series of articles on your site, and you want to ensure your readers can follow the sequence within the series, In-Series will help you provide the links between the posts and articles, improving your site’s navigation.

The plugin creates three new template tags available for use in your theme’s single.php:

previous_in_series()
displays a link to the previous post in the series, if there is one. If the current post is the first post in the series, this template tag will not display anything.
next_in_series()
displays a link to the next post in the series, if there is one. If the current post is the last post in the series, this template tag will not display anything.
all_in_series()
displays a list of links to each post in the series. The current post is not linked, to ensure the reader knows where in the series they are.
series_table_of_contents()
displays a clickable link for each post’s title as an ordered list(<ol><li>…</li></ol>)

Then simply apply two new custom fields to the posts in your series:

series_name
a unique name for the series
series_order
the current post’s position in the series

Examples are provided in the in-series.txt included in the zip file.

UPDATE: Thanks to Lorelle for spotting an error with sorting long tables of contents; and to ColdForged and necrotic for their help pointing me toward the solution. Version 1.2 is now available. UPDATE: Thanks to Lorelle for the suggestion to make a table of contents! Version 1.1 includes the new function series_table_of_contents(). UPDATE: Thanks to Monika for alerting me to an error in series_table_of_contents. This is fixed, and version 1.3 is now available for download. UPDATE: Version 1.4 is now available for download. It fixes a flaw in the sorting of posts in a series. UPDATE: Version 1.5 is now available. Thanks to io_error for pointing out that previous versions incorrectly included draft posts in the series. Also added $before and $after to series_table_of_contents(). UPDATE: Version 1.6 is now available. Thanks again to io_error for pointing out that static pages were excluded from series. You can now construct a series composed of posts and pages.

Download In-Series 1.6!


home / about / posts / notes / RSS