Shortcode: [series_toc]

[series_toc] is a shortcode that's available in the Pro version of PublishPress Series. This shortcode displays the list of all your series. The output via this shortcode has its layout controlled by the “Series Table of Contents Listings” template found in the series options page. You can see an example of this shortcode's display in the image below:

Toc Shortcode
Toc Shortcode

How to use the [series_toc] shortcode

The [series_toc] shortcode can be modified with different parameters:

  • orderby: The options are: name, series_id, count, and slug. This controls what series data point you want the series sorted on. The default is series_id.
  • order: The options are: ascending and descending. This controls how you want the series sorted, based on the orderby selection. The default is descending.
  • hide_empty The options are: yes and no. Do you want series with no assigned posts to be excluded from the list? The default is yes.
  • exclude: This is a comma delimited list of series ids for series you DON'T want included.  If you have a value in the “include” parameter, the exclude parameter is ignored. Default is none.
  • include: This is comma delimited list of series ids for series you DO want included. Default is All.
  • number: The number of series you want displayed. Default is all.
  • offset: If you want to offset the series pulled from the database from the sorted list you can indicate so using this parameter. Default is no offset.
  • search: If you want to only display series that match a search term (against the series name), you can use this parameter. Default is no search.

You can manually add the parameters for the shortcode using the following format:

[[series_toc orderby="name" order="ASC" hide_empty="false" include="701, 703, 777"]

In the above example, here are the parameters:

  • orderby: the series that will be rendered will be ordered by the series names
  • order: the series will be shown in ascending order (alphabetically). 
  • hide_empty: Any series with no posts assigned WILL be shown. 
  • include: The series displayed will be those with the series ID 701, 703, and 777

Professional publishing plugins for WordPress! Get PublishPress