Skip to content

Commit

Permalink
menu stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
briankelleher committed Feb 23, 2016
1 parent 1bb2f48 commit f6d7451
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion www/wp-content/themes/ation2016/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) );
Expand All @@ -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;
}
Expand Down

0 comments on commit f6d7451

Please sign in to comment.