public function init()
 {
     // Load lib
     $this->load_php_files_from_path(__DIR__ . '/lib');
     // Load post objects
     if (class_exists('Clarkson_Core_Objects')) {
         Clarkson_Core_Objects::get_instance();
     }
     // Load template routing
     if (class_exists('Clarkson_Core_Templates')) {
         Clarkson_Core_Templates::get_instance();
     }
 }
 public function template_include($template)
 {
     $extension = pathinfo($template, PATHINFO_EXTENSION);
     $type = basename($template);
     $type = str_replace(".{$extension}", '', $type);
     // Doublecheck
     if (isset($this->templates[$type])) {
         $template = $this->templates[$type];
         $extension = 'twig';
     }
     if ($extension === 'twig') {
         // Get template vars
         global $posts;
         $object_loader = Clarkson_Core_Objects::get_instance();
         $page_vars = array();
         if (is_author()) {
             $user = $object_loader->get_users($posts);
         } elseif (is_tax()) {
             $term = get_queried_object();
             // Custom Taxonomy Templates per Taxonomy type
             if (is_a($term, 'WP_Term')) {
                 $page_vars['term'] = $object_loader->get_term($term);
                 $page_vars['objects'] = $object_loader->get_objects($posts);
             }
         } else {
             $page_vars['objects'] = $object_loader->get_objects($posts);
         }
         // Render it
         $this->render($template, $page_vars);
     }
     return $template;
 }