Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress From Bootstrap to WordPress Setup a Bootstrap Theme Creating Bootstrap Navigation in WordPress

Maximiliane Quel
Maximiliane Quel
Courses Plus Student 55,489 Points

To add or not add theme support

Looking at the WordPress Codex for the register_nav_menus function it reads in the notes:

This function automatically registers custom menu support for the theme therefore you do not need to call add_theme_support( 'menus' );

wordpress codex

So should we just cut this bit of code out of our functions.php or is there are reason why we are doing it nevertheless? Am I looking at the wrong part of the codex? Is our example different in some way? Should I read no need to as but you can if you want to?

2 Answers

The behavior of register_nav_menus() was modified in WP 3.0. Explicitly calling add_theme_support( 'menus' ); would probably be for legacy support on older releases (2.9, 2.9.1, 2.9.2). Realistically, though, with the current release up to 3.9, this should be a non-issue.

That said, calling add_theme_support( 'menus' ); multiple times makes no difference to the theme, so keeping it won't hurt anything.