Timber not activated. Make sure you activate the plugin in ' . esc_url( admin_url( 'plugins.php' ) ) . '
'; } ); add_filter( 'template_include', function( $template ) { return get_stylesheet_directory() . '/static/no-timber.html'; } ); return; } /** * Sets the directories (inside your theme) to find .twig files */ Timber::$dirname = array( 'templates', 'views' ); /** * By default, Timber does NOT autoescape values. Want to enable Twig's autoescape? * No prob! Just set this value to true */ Timber::$autoescape = false; // REMOVE EDITOR function remove_editor() { remove_post_type_support('page', 'editor'); remove_post_type_support('page', 'comments'); remove_post_type_support('post', 'editor'); remove_post_type_support('post', 'comments'); remove_post_type_support('post', 'author'); remove_post_type_support('post', 'excerpt'); remove_post_type_support('post', 'revisions'); }; add_action('admin_init', 'remove_editor'); /** * We're going to configure our theme inside of a subclass of Timber\Site * You can move this to its own file and include here via php's include("MySite.php") */ class StarterSite extends Timber\Site { /** Add timber support. */ public function __construct() { add_action( 'after_setup_theme', array( $this, 'theme_supports' ) ); add_filter( 'timber/context', array( $this, 'add_to_context' ) ); add_filter( 'timber/twig', array( $this, 'add_to_twig' ) ); add_action( 'init', array( $this, 'register_post_types' ) ); add_action( 'init', array( $this, 'register_taxonomies' ) ); parent::__construct(); } /** This is where you can register custom post types. */ public function register_post_types() { } /** This is where you can register custom taxonomies. */ public function register_taxonomies() { } /** This is where you add some context * * @param string $context context['this'] Being the Twig's {{ this }}. */ public function add_to_context( $context ) { $context['foo'] = 'bar'; $context['stuff'] = 'I am a value set in your functions.php file'; $context['notes'] = 'These values are available everytime you call Timber::context();'; $context['menu'] = new Timber\Menu(); $context['site'] = $this; return $context; } public function theme_supports() { // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' ); /* * Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded