Menu not displaying in NavBar. Keeps saying, ‘Add Menu’ But it already exists.

  • Unknown's avatar

    Hello.

    So i am developing a theme on local host and are using bootsrap and navwalker to add bootstrap navbar.
    But even though i have added the navbar it wont display it keeps saying ‘Add menu’ but it already exits. I have switched themes and removed all plugins but nothing,

    This is the header.php code.

    Ngina Speaks


    Ngina Speaks

    As you can see i am using nav walker

    and this is the adding of the scrips files plus the navwalker functions

    //Navwalker

    function register_navwalker(){
    require_once get_template_directory() . ‘/class-wp-bootstrap-navwalker.php’;
    }
    add_action( ‘after_setup_theme’, ‘register_navwalker’ );

    if ( ! file_exists( get_template_directory() . ‘/class-wp-bootstrap-navwalker.php’ ) ) {
    // File does not exist… return an error.
    return new WP_Error( ‘class-wp-bootstrap-navwalker-missing’, __( ‘It appears the class-wp-bootstrap-navwalker.php file may be missing.’, ‘wp-bootstrap-navwalker’ ) );
    } else {
    // File exists… require it.
    require_once get_template_directory() . ‘/class-wp-bootstrap-navwalker.php’;
    }

    function wp_theme_setup(){
    //nav menus
    register_nav_menus( array(
    ‘primary’ => __( ‘Primary Menu’)
    ) );

    }

    //add scripts Js and CSS

    function theme_setup() {

    //fonts
    wp_enqueue_style(‘google-fonts’, ‘//fonts.googleapis.com/css2?family=Great+Vibes&display=swap’);
    //fontawesome
    wp_enqueue_style( ‘fontawesome-stylesheet’, get_template_directory_uri() . ‘/css/font-awesome.css’, array( ” ), ‘20170106’ );
    //styles
    wp_enqueue_style(‘style’, get_stylesheet_uri(), NULL, microtime());
    wp_enqueue_style( ‘fontstyling’, get_template_directory_uri() . ‘/css/all.css’, NULL, microtime());
    wp_enqueue_style( ‘aboutpage’, get_template_directory_uri() . ‘/css/about.css’, NULL, microtime());
    wp_enqueue_style( ‘singlepost’, get_template_directory_uri() . ‘/css/singlepost.css’, NULL, microtime());
    //script
    wp_enqueue_script( ‘main’, get_theme_file_uri( ‘/js/main.js’ ), NULL, microtime(), true );
    //add bootstrap stylesheet
    wp_enqueue_style( ‘bootstrap-style’, get_template_directory_uri() . ‘/css/bootstrap.min.css’);
    //add bootsrap scrips
    wp_enqueue_script( ‘bootstrap-script’, get_template_directory_uri() . ‘js/bootstrap.min.js’);
    //add custom scripts to your theme
    }

    add_action(‘wp_enqueue_scripts’, ‘theme_setup’);

    Also it does not seem to toggle on small screen

  • Hey there, it sounds like you meant to post here:
    https://wordpress.org/support/forums/

    There’s a developer forum there with a friendly community.

    These forums are specific to the sites using our managed service, specifically the free site:

    WordPress.com vs. WordPress.org

    Good luck!

  • The topic ‘Menu not displaying in NavBar. Keeps saying, ‘Add Menu’ But it already exists.’ is closed to new replies.