Series Table of Contents Template
In this guide, we focus on Series Table of Contents template.
The Series Table of Contents page is where you'd display all of the series for your readers to browse. This next image is an example of the Series Table of Contents page:
The Series Table of Contents is a page on your blog that lists all the series you've written. The output of this page is controlled by three things.
First, the “Series Table of Contents URL” is the “Display” section of the PublishPress Series options screen. This setting is the location of the Series Table of Contents page.
Second, the “Series Table of Contents” is in the “Templates” section of the PublishPress Series options screen.
Third, In the
organize-series folder within your WordPress plugins folder, you'll see a file called
seriestoc.php. That file is what gets loaded when you go to the series table of contents URL.
For those who want to get more customized with the display of the Series Table of Contents template here are some template tags (functions) you can use. All of these template tags are found in the
orgSeries-template-tags.php file which contains inline documentation.
wp_serieslist_display_code()– This will output a formatted output of the indicated series and does not have to be in the WordPress Loop. It accepts two parameters: the series id of the series to be listed (required), and what page is calling this function (not required). Remember this function does not output a list of all the series you've written, it only prints the output for the given series. The output is controlled by the “series table of contents template” as explained in this post.
wp_serieslist_display()– This is the function you will use if you want to output the entire list of non-empty series you've written. All it does is query the database for the series you've written that contain posts and then calls
wp_serieslist_display_code()for each series in the list. Again, this function also does not need to be called from within the WordPress Loop.
It's possible that the default layout doesn't look great with your theme. The default file included is a rough template for what can be done but by no means is designed to work well with all themes.
Here's how to more tightly integrate the appearance of this page with the rest of your theme:
- Copy the
seriestoc.phpfile from the
organize-seriesfolder in your plugins folder to your active theme's folder.
- Using another archive template in your theme as a base for containing HTML structure, modify the
seriestoc.phpfile so it has a similar HTML structure for containing the content. You do not need to put any of the WordPress loop code in this file.