Templates

Michael Sisk edited this page Mar 18, 2013 · 12 revisions
Clone this wiki locally

Webcomic extends the normal WordPress template hierarchy and utilizes a number of unique templates for certain features, allowing you to customize the display of webcomics, prints, restricted access messages, webcomic transcripts, and more. These templates must be named appropriately and placed in a webcomic directory inside of the current theme directory (either the active theme or the theme you've selected for a given collection). The lists below represent the complete template hierarchies that will be searched, starting with the highest-priority template.

Home Page

Special Note: This hierarchy only applies when your front page is also your blog posts index (the default WordPress behavior).

  1. webcomic/home.php
  2. home.php
  3. index.php

Single Post

  1. single-{$collection}.php
  2. webcomic/single.php
  3. single.php
  4. index.php

Prints

Handles the display of webcomic print pages, accessed by using the purchase_webcomic_link template tag, by adding /prints to the end of webcomic post URL's (when pretty permalinks are enabled), or by adding a prints URL parameter to a webcomic post URL. This template is useful for presenting print purchasing options in a unique way.

  1. webcomic/prints-{$collection}.php
  2. webcomic/prints.php
  3. single-{$collection}.php
  4. webcomic/single.php
  5. single.php
  6. index.php

Dynamic

Handles the display of dynamically-loaded Webcomic content when using Dynamic Navigation. This template will be loaded into a webcomic container in an existing page, but the template itself functions similarly to a WordPress single post template. Only the part of the page that is being loaded dynamically should be included in this template; this will usually include, at a minimum, the webcomic image and related navigation.

  1. webcomic/dynamic-{$collection}-{$container}.php
  2. webcomic/dynamic-{$container}.php
  3. webcomic/dynamic-{$collection}.php
  4. webcomic/dynamic.php
  5. If no dynamic template can be found Webcomic will use the bundled template found at -/php/integrate/dynamic.php.

Page

  1. custom template file
  2. page-{$slug}.php
  3. page-{id}.php
  4. webcomic/page-{$collection}.php
  5. webcomic/page.php
  6. page.php
  7. index.php

Storylines and Characters

  1. taxonomy-{$taxonomy}-{$term}.php
  2. taxonomy-{$taxonomy}.php
  3. webcomic/storyline.php or webcomic/character.php
  4. webcomic/taxonomy.php
  5. taxonomy.php
  6. webcomic/archive.php
  7. archive.php
  8. index.php

Crossovers

Handles the display of crossover storylines and character archives, accessed by using the various crossover template tags, by adding /crossover to the end of a storyline or character archive URL (when pretty permalinks are enabled), or by adding a crossover URL parameter to a storyline or character archive URL.

  1. webcomic/crossover-{$taxonomy}-{$term}.php
  2. webcomic/crossover-{$taxonomy}.php
  3. webcomic/crossover-storyline.php or webcomic/crossover-character.php
  4. webcomic/crossover.php
  5. taxonomy-{$taxonomy}-{$term}.php
  6. taxonomy-{$taxonomy}.php
  7. webcomic/storyline.php or webcomic/character.php
  8. webcomic/taxonomy.php
  9. taxonomy.php
  10. webcomic/archive.php
  11. archive.php
  12. index.php

Collections

  1. archive-{$collection}.php
  2. webcomic/collection.php
  3. webcomic/archive.php
  4. archive.php
  5. index.php

Attachments

  1. webcomic/{$mime}-{$collection}.php
  2. webcomic/{$mime}.php
  3. webcomic/{$type}-{$collection}.php
  4. webcomic/{$type}.php
  5. webcomic/{$mime}_{$type}-{$collection}.php
  6. webcomic/{$mime}_{$type}.php
  7. webcomic/attachment-{$collection}.php
  8. webcomic/attachment.php
  9. {$mime}.php
  10. {$type}.php
  11. {$mime}_{$type}.php
  12. attachment.php
  13. single-attachment.php
  14. single.php
  15. index.php

Age Restricted

Handles the display of Webcomic content restricted by user age. This template is useful for controlling how warnings and errors are displayed when a user with an indeterminate or inappropriate age attempts to view age-restricted content.

  1. webcomic/restricted-age-{$collection}.php
  2. webcomic/restricted-age.php
  3. webcomic/restricted.php
  4. If no restricted age template can be found Webcomic will use the bundled template found at -/php/integrate/restricted-age.php.

Role Restricted

Handles the display of Webcomic content restricted by user role. This template is useful for controlling how warnings and errors are displayed when a user with an indeterminate or inappropriate role attempts to view role-restricted content.

  1. webcomic/restricted-role-{$collection}.php
  2. webcomic/restricted-role.php
  3. webcomic/restricted.php
  4. If no restricted role template can be found Webcomic will use the bundled template found at -/php/integrate/restricted-role.php.

Feeds

Handles the display of webcomic previews in site feeds when feed integration is enabled. Content must be assigned to the $prepend or $append variables to display additional content above or below the normal post content (direct output may cause errors). An $attachments array is available that contains Webcomic-recognized WordPress media objects, and a $feed_size variable is available that holds the selected feed preview size for the current collection.

  1. webcomic/feed-{$collection}.php
  2. webcomic/feed.php
  3. If no feed template can be found Webcomic will use the bundled template found at -/php/integrate/feed.php

Transcripts

Handles the display of Webcomic transcripts, similar to WordPress' own Comments template. This template is useful for displaying transcripts related to the current webcomic, as well as providing a transcription form for user-submitted transcripts.

Themes must provide their own transcripts template if they are not using integration.

  1. webcomic/transcripts-{$collection}.php
  2. webcomic/transcripts.php

Integrate - Loop Start

Handles the display of Webcomic content when a main loop begins. This is useful for displaying webcomics on the home page or on single webcomic pages or additional storyline or character archive information. You can use conditional tags to differentiate one page from another and display content appropriately.

  1. webcomic/loop_start-{$collection}.php
  2. webcomic/loop_start.php
  3. If no loop start template can be found Webcomic will use the bundled template found at -/php/integrate/loop_start.php.

Integrate - Loop End

Handles the display of Webcomic content when a main loop ends. This is useful for displaying additional webcomic information, generally near the bottom of the page. You can use conditional tags to differentiate one page from another and display content appropriately.

  1. webcomic/loop_end-{$collection}.php
  2. webcomic/loop_end.php
  3. If no loop start template can be found Webcomic will use the bundled template found at -/php/integrate/loop_end.php.

Integrate - The Content

Handles the display of Webcomic content for individual posts. This is useful for appending or prepending additional Webcomic information to the post content. Content must be assigned to the $prepend or $append variables to display additional content above or below the normal post content (direct output may cause errors).

  1. webcomic/the_content-{$collection}.php
  2. webcomic/the_content.php
  3. If no content template can be found Webcomic will use the bundled template found at -/php/integrate/the_content.php.

Integrate - The Excerpt

Handles the display of Webcomic content for individual posts. This is useful for appending or prepending additional Webcomic information to the post excerpt. Content must be assigned to the $prepend or $append variables to display additional content above or below the normal post excerpt (direct output may cause errors).

  1. webcomic/the_excerpt-{$collection}.php
  2. webcomic/the_excerpt.php
  3. If no excerpt template can be found Webcomic will use the bundled template found at -/php/integrate/the_excerpt.php.