The plugin code to show the TOC page is:
function orgSeries_toc_template() {
global $wp_query;
$settings = $this->settings;
if ( isset($wp_query->is_seriestoc) && $wp_query->is_seriestoc ) {
$template = locate_template(array('seriestoc.php')); // Search custom file in theme directory
if (!$template)
$template = WP_CONTENT_DIR . '/plugins/' . SERIES_DIR .'/seriestoc.php';
include($template);
exit;
}
}
As the file seriestoc.php
is not a regular page template, we cannot use is_page_template()
. But we can use the same technique as the plugin:
global $wp_query;
if ( isset($wp_query->is_seriestoc) && $wp_query->is_seriestoc ) {
// do_something();
}