Why is my Navbar not expanding in Wordpress?

Viewed 46

I'm currently trying to create a navbar in wordpress.

However when the navbar collapses and the burger icon remains, the navbar doesn't expand.

I Looked in Chrome Dev tools and tried to use $() but it says undefined, which makes me think that jquery isn't loading however, i enqueue it in functions.php

I'm a bit confused clarification would be appreciated.

My Code:

<?php 
    function enqueue_kraken_theme(){

        //style
        wp_enqueue_style( 
            "style",
            get_template_directory_uri(  ) ."/style.css",
            array()
        );

          //bootstrap css
          wp_enqueue_style( 
            "bootstrap",
            get_template_directory_uri(  ) . "/bootstrap/css/bootstrap.min.css",
            array(),
            "3.4.1",
            "all"
        );

        //Jquery 
        wp_enqueue_script( 
            "jquery",
            get_template_directory_uri(  ) . "/js/jquery-3.4.1.js",
            array("jquery"),
            "4.4.1",
            true 
        );

        //bootstrap js
        wp_enqueue_script( 
            "bootstrap",
            get_template_directory_uri(  ) . "/bootstrap/js/bootstrap.min.js",
            array(),
            "3.4.1",
            true 
        );
    }

    add_action("wp_enqueue_scripts", "enqueue_kraken_theme");

    function kraken_theme_setup(){

        add_theme_support( "menus" );

        register_nav_menu( "primary", "Primary Header Navigation" );
    }
    add_action( "after_setup_theme", "kraken_theme_setup" );
1 Answers

I think that jquery is registered incorrectly. you should replace the jquery to new version.

wp_register_script( 'jquery', get_template_directory_uri( ) . "/js/jquery-3.4.1.js", null, null, true ); wp_enqueue_script('jquery');

Related