Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm adding a menu and sub-menus via the admin_menu hook in my functions.php. One of the sub-menus I want to add is menus.

I want to make sure that the theme supports menus before I do that, so I tried using the current_theme_supports function, but it returns false, apparently because $_wp_theme_features is still null at this stage.

What should I do? Do you think I really need this check, if I'm anyway in my functions.php? And if I do - should I use a later hook to create my menus? Or any other solution?

share|improve this question

1 Answer 1

Not really sure what you're asking here, but this allows theme support for navigation menus in your theme.

Place this block of code in your theme's functions.php file.

if(function_exists('register_nav_menus')){
    register_nav_menus(
        array(
            'header_navigation' => 'Header Navigation',
            'main_navigation' => 'Main Navigation',
            'footer_navigation' => 'Footer Navigation'
        )
    );
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.