Storyline Basics

A word before you go any further: For ComicPress Core to work properly, posts can only be in one category! ComicPress Core will reject any post in more than one category. If you want to put your posts in additional taxonomies, use tags.

Methodology

Unlike prior versions of ComicPress, ComicPress Core treats all categories with equal weight. For sites that want to run multiple comics, or multiple prose stories, and want to take advantage of the advanced navigation and storyline features, no one master category can be defined as a "comic" category. Instead, when navigation is constructed, if you want posts only from one category, you specify that category's slug while constructing the navigation.

Child Category Ordering

A storyline in ComicPress Core parlance is a set of ordered, structured categories. By default, categories in WordPress maintain only parent to child relationships — a category knows if it has a parent, and what that parent is. See the category list below:

While WordPress stores parent/child relationships, it does not store the order of all of the children underneath of a parent (the siblings). It always sorts them alphabetically by name. This is bad for Websites that want to run structured sequential creative works, as that means you'd have to name your categories in a way that would cause them to sort alphabetically, making the names nonsensical:

ComicPress Core allows you to sort your categories in any order, and that order is stored within ComicPress Core's own configuration. This would allow you to ensure that My Funny Comic always appears before My Serious Comic, no matter how many children My Comics has.

Extending WordPress to Know About Sort Ordering

In order for theme developers to be able to access this sort ordering information, ComicPress Core provides two template tags called SL() and SC() to retrieve information about the structure of categories. It's a much richer interface than WordPress's provided interface, because they always return hierarchical information:

foreach (SL() as $category_id => $info) {
  $category = get_category($category_id);
  printf('Category %d is %d levels deep', $category->name, $info['level']);
}

// by default, SC() returns categories relative to the current post
$next = SC('next');
$previous = SC('previous');
$parent = SC('parent');

// or you can provide a category to be relative to
$next_from_three = SC('next', 3);
$previous_to_chapter_four = SC('previous', 'chapter-four');

Finding and Using Posts

Since ComicPress Core knows about the structure of your storyline, you can use ComicPress Core's advanced post search template tags to search subsets of your categories. This is where a cool interactive goes that illustrates this complex process.