/** * Handle redirects before content is output - hooked into template_redirect so is_page works. * * @access public * @return void */ function wolf_discography_template_redirect() { if (is_page(wolf_discography_get_page_id())) { wolf_discography_get_template('discography-template.php'); exit; } }
/** * wolf_discography page link * * retrieve discography page permalink * * * @access public * @param string $page * @return string */ function wolf_discography_get_page_link() { $page_id = wolf_discography_get_page_id(); if ($page_id != -1) { return get_permalink($page_id); } }
/** * Check if we're on a discography page * * @return bool */ function wolf_is_discography() { return function_exists('wolf_discography_get_page_id') && is_page(wolf_discography_get_page_id()) || is_tax('label') || is_tax('band'); }
/** * Add specific class to the body when we're on the discography page * * @param array $classes * @return array $classes */ public function body_class($classes) { if (is_page(wolf_discography_get_page_id())) { $classes[] = 'discography-page'; } // if ( 'release' == get_post_type() ) { // $classes[] = 'discography'; // } return $classes; }
/** * Add specific class to the body when we're on the discography page * * @param array $classes * @return array $classes */ public function body_class($classes) { if (is_page(wolf_discography_get_page_id())) { $classes[] = 'discography-page'; } if (!is_singular('release') && ('release' == get_post_type() || function_exists('wolf_discography_get_page_id') && is_page(wolf_discography_get_page_id()))) { $classes[] = 'wolf-discography'; } return $classes; }