public function __construct() { Timber::$dirname = 'app/templates'; self::addThemeSupport(); static::registerComponents(); static::addEditorConfig(); \add_filter('timber_context', array($this, 'initializeContext')); \add_filter('get_twig', array($this, 'addToTwig')); \add_action('init', array($this, 'registerViews'), 11); \add_action('init', array($this, 'registerTaxonomies'), 12); \add_action('init', array($this, 'registerPostTypes'), 13); \add_action('init', array($this, 'registerOptionPages'), 14); \add_action('init', array($this, 'registerNavigations'), 15); \add_action('admin_menu', array($this, 'customizeAdminMenu'), 10); \add_action('wp_enqueue_scripts', array($this, 'enqueScripts'), 100); \add_action('wp_enqueue_scripts', array($this, 'enqueDefaultStylesheets'), 100000); \add_action('wp_enqueue_scripts', array($this, 'enqueStylesheets'), 102); \add_action('admin_enqueue_scripts', array($this, 'enqueAdminStylesheets'), 100); \add_filter('wp_title', array($this, 'wpTitle')); \add_filter('template_include', array($this, 'renderView'), 100000); // Warm custom template cache \add_action('init', array($this, 'loadPageTemplates'), 1); parent::__construct(); }
<?php namespace Trendwerk\Sphynx; use Timber\Timber; $timber = new Timber(); Timber::$dirname = array('templates/base', 'templates'); $theme = new Theme(); $theme->init();
<?php use Timber\Timber; $timber = new Timber(); Timber::$dirname = 'views';