From f6d74515ae02059eaefa485cb9e784dbf88eebd6 Mon Sep 17 00:00:00 2001 From: briankelleher Date: Tue, 23 Feb 2016 14:54:54 -0500 Subject: [PATCH] menu stuff --- www/wp-content/themes/ation2016/functions.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/www/wp-content/themes/ation2016/functions.php b/www/wp-content/themes/ation2016/functions.php index 0377eab..df02ef3 100755 --- a/www/wp-content/themes/ation2016/functions.php +++ b/www/wp-content/themes/ation2016/functions.php @@ -14,7 +14,13 @@ class StarterSite extends TimberSite { function __construct() { add_theme_support( 'post-formats' ); add_theme_support( 'post-thumbnails' ); + + // Menus add_theme_support( 'menus' ); + register_nav_menus( array( + 'primary' => 'Primary Menu', + ) ); + add_filter( 'timber_context', array( $this, 'add_to_context' ) ); add_filter( 'get_twig', array( $this, 'add_to_twig' ) ); add_action( 'init', array( $this, 'register_post_types' ) ); @@ -35,7 +41,7 @@ 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::get_context();'; - $context['menu'] = new TimberMenu(); + $context['menu'] = new TimberMenu('primary'); $context['site'] = $this; return $context; }