timber / starter-theme

The "_s" for Timber: a dead-simple theme that you can build anything from
MIT License
812 stars 274 forks source link

bug report: menu.twig is not sound #99

Closed flip111 closed 8 months ago

flip111 commented 4 years ago

menu.twig is including here https://github.com/timber/starter-theme/blob/master/templates/base.twig#L18 with passed parameter items

This condition https://github.com/timber/starter-theme/blob/master/templates/menu.twig#L1 never triggers because variable menu is not available.

marciojcoelho commented 3 years ago

@flip111 can you confirm that you have $context['menu'] = new Timber\Menu(); in functions.php ?

https://github.com/timber/starter-theme/blob/1.x/functions.php#L87

captnsassypantz commented 3 years ago

The issue could also be if you don't have a menu initialized in your WP dashboard. Or, you didn't pass your desired menu slug through to the variable @marciojcoelho mentioned.

https://timber.github.io/docs/guides/menus/#initializing-a-menu

Levdbas commented 8 months ago

Closing as outdated