global $post; if ($post->post_type == CHERRY_SERVICES_NAME) { $template = trailingslashit(CHERRY_SERVICES_DIR) . 'templates/single-services.php'; } return $template; } public function page_template_classes($atts, $context) { if ('services-template' != $context) { return $atts; } $atts['class'] .= ' services-page'; return $atts; } /** * Returns the instance. * * @since 1.0.0 * @return object */ public static function get_instance() { // If the single instance hasn't been set, set it now. if (null == self::$instance) { self::$instance = new self(); } return self::$instance; } } Cherry_Services_Templater::get_instance();