To present a list showing all posts from a single series of related writings.
This can be accomplished in a myriad of ways. A quick look at the plugin repository shows that most plugins for series management utilize some taxonomy to accomplish post relations. This is a good and natural solution, especially for the end-user. I could also imagine a custom meta field being used. I’ve opted to implement this feature on this blog via a simple code snippet. There are a few benefits of this approach.
- It does not require the addition of another plugin. (To manage the snippet, I do use Code Snippets which I’ve already installed for other purposes.)
- Posts within a series can easily extend across custom post types. (If I ever had such a need.)
- All aspects of the series can be managed from one location.
- In order to add or remove posts from a series, I do not need to edit each post individually.
- Change the name of the series directly in the snippet.
- Control how the series list is displayed along the content of the post.
The drawback is that it requires me to edit code every time I’d like to modify a series, thus not a great solution for widespread use by non-technical authors. Here is the snippet I have added to my site. The code should explain itself.
All I need do to add a series is add an additional element to the
$series array. I can then add posts to a series by adding post IDs to its corresponding array. You can see the results of this snippet here and here.