Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.