Ryan Hinchliffe
Ryan Hinchliffe

Reputation: 167

Why is my header displaying my footer in wordpress?

I'm Currently Making a Header and Footer in Wordpress.

When I use wp_nav_menu and use the theme location primary. I'm trying to grab the header. Which i've set to primary in functions.php.

However it ends up displaying my footer.

I've also set the display location to "header" in menus. Am i missing something?

header.php

<?php 
             wp_nav_menu( array(
             "theme-location" => "primary",
             "container" => "ul",
             "menu_class" => "navbar-nav mr-auto"
                        ));

?>

functions.php

 function kraken_theme_setup(){

        add_theme_support( "menus" );

        register_nav_menu( "primary", "Primary Header Navigation" );
        register_nav_menu( "secondary", "Footer Navigation");
    }
    add_action( "after_setup_theme", "kraken_theme_setup" );

Upvotes: 1

Views: 443

Answers (1)

Alexis Vandepitte
Alexis Vandepitte

Reputation: 2088

You have a typo in your wp_nav_menu arguments.

theme-location should be theme_location with _

Everything seems ok except that.

Upvotes: 1

Related Questions