Cannot open mobile navigation in Bootstrap 4

I need assistance with my navigation menu in the index.html file. I copied the code from a previous website that was working, but now when I click on the hamburger icon, nothing happens - it doesn't even switch to the closed state. Here is the code for my navigation menu:

<nav class="navbar navbar-default navbar-expand-lg navbar-light navcolor-height nav-font-size" style="background-color: #d58e8db0;">
    <div class="container">
        <a class="navbar-brand" href="<?php echo esc_url( home_url( '/' ) ); ?>">
            <img src="<?php bloginfo('template_url'); ?>/assets/images/keddingtonhouselogo.png" alt="Logo">
       </a>

       <button class="hamburger hamburger--spring" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="hamburger-box">
                      <span class="hamburger-inner"></span>
                    </span>
                  </button>

        <div class="collapse navbar-collapse flex-column align-items-end rem-1p2" id="navbarCollapse">
            <!-- navbar1 -->
            <div class="navbar-nav mb-lg-0 topnavbar">
                <img src="<?php bloginfo('template_url'); ?>/assets/images/phone-icon.png" class="margin-top-9">
                <a class="nav-item nav-link" href="tel:+441507603973">01507 603973</a>
                <img src="<?php bloginfo('template_url'); ?>/assets/images/email-icon.png" class=" margin-left-10 margin-top-9">
                <a class="nav-item nav-link" href="mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3b52555d547b505e5f5f52555c4f545553544e485e155854154e50">[email protected]</a>"><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5930373f3619323c3d3d30373e2d363731362c2a3c773a36772c32">[email protected]</a>
            </div>

            <!-- navbar2 -->
            <ul class="navbar-nav mt-0 ">
                <li class="nav-item active">
                    <a class="nav-link" href="<?php echo esc_url( home_url( '/' ) ); ?>">Home <span class="sr-only">(current)</span></a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="<?php echo esc_url( home_url( '/facilities' ) ); ?>">Facilities</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="<?php echo esc_url( home_url( '/directions' ) ); ?>">Directions</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="<?php echo esc_url( home_url( '/photos' ) ); ?>">Photos </a>
                </li>
                <li class="nav-item ">
                    <a class="nav-link" href="<?php echo esc_url( home_url( 'bookings' ) ); ?>">Bookings</a>
                </li>
            </ul>
        </div>
    </div>
</nav> 

I haven't yet applied the NavWalker for Wordpress. Any help solving this issue would be greatly appreciated.

Update: The errors I'm seeing in the console can be viewed here.

UPDATE 2: Below is my Functions.php

function use_these_scripts()
{
//JavaScript Scripts
wp_enqueue_script( 'slick-js', get_template_directory_uri() . '/assets/js/slick.js', array(), true ); //Slick.JS
wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . '/assets/plugins/bootstrap/js/bootstrap.min.js', array(), true ); //Bootstrap Minify.JS
wp_enqueue_script( 'jQuery-js', get_template_directory_uri() . '/assets/js/jquery.min.js', array(), true );
wp_enqueue_script( 'Popper-js', get_template_directory_uri() . '/assets/js/Popper.min.js', array(), true );
//echo "JS Call Testing";
 }

 add_action('wp_enqueue_scripts', 'use_these_scripts');


 function OurCSS()
 { 
wp_enqueue_style( 'slickcss', get_stylesheet_directory_uri() . '/assets/css/slick.css' );
wp_enqueue_style( 'slick-theme-css', get_stylesheet_directory_uri() . '/assets/css/slick-theme.css' );
wp_enqueue_style('font-awesome', 'https://use.fontawesome.com/releases/v5.0.1/css/all.css');
wp_enqueue_style( 'hamburger_css', get_stylesheet_directory_uri() . '/assets/css/hamburger.min.css' );
wp_enqueue_style( 'bootstrap-css', get_stylesheet_directory_uri() . '/assets/plugins/bootstrap/css/bootstrap.min.css' );
wp_enqueue_style( 'main_css', get_stylesheet_directory_uri() . '/assets/css/KeddingtonHouse.css' );

//echo "CSS Call Testing";
}

add_action( 'wp_enqueue_scripts', 'OurCSS' );

Answer №1

Make sure to include jQuery before the closing </head> tag and add bootstrap.js after including jQuery.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

SoundCloud and Vimeo have the capability to link their players across separate tabs, and even between tabs and embedded players

I find it intriguing how SoundCloud and Vimeo are synchronized with their tabs, so that when you play something in one tab, the others pause. It's worth noting that this feature only works on SoundCloud when two instances of the website are open, wher ...

Issue with Bootstrap 4 column width when using Angular 2 *ngFor

I have a container that displays search results. The layout is set up using Bootstrap columns, but there seems to be excessive padding or margin causing the results to appear very narrow. Interestingly, if I manually input each result instead of using *ngF ...

Steps for Loading the Icomoon FontIs this web text just

I'm having trouble getting Icomoon fonts to display on my website. I downloaded the files and placed them in my /fonts directory, following the steps outlined here. I edited icomoon/style.css with the appropriate font-face code: @font-face { font ...

CSS and JavaScript dropdown malfunctioning due to a position swap in internal CSS

This example demonstrates functionality .c1 { background-color:red; position:relative; } .c2 { background-color:blue; position:absolute; height:50px; width:100px; display:none;} .show { display:block; } <body> <button ...

The effectiveness of Tailwind utility classes is exclusive to CSS files rather than inline code

My tech stack includes electron, react (web), typescript, and tailwind. Currently, I am encountering an issue where tailwind only applies styles in .css files but not inline. See the example below: In .css file (works) .navbar { @apply border-2 border ...

What is the best way to adjust Material UI Grid properties according to the screen size?

I am working with Material UI and have a grid on the homepage that needs to maintain certain properties regardless of screen size. However, I want to apply a negative margin when the screen reaches 1200px or larger (lg). Currently, the grid is set up like ...

How to Safely Swap Background Images on a Website Using CSS without Affecting the Body

How can I create a background similar to this one, but using an image instead of the blue background? Take a look at I noticed that resizing the browser window doesn't affect the background. What steps should I take to achieve this effect? ...

Wagtail Django TableBlock not showing up properly on the webpage

Recently delving into the world of Django and programming, I decided to incorporate Wagtail into my website. However, I've encountered a roadblock with the 'TableBlock' functionality Despite setting up the model and block correctly, I&apos ...

By employing timeUpdate in conjunction with currentTime

I am looking to utilize the timeUpdate and currentTime functionalities to display or hide a div at a specific time during video playback. I have been able to make it work, but it seems to be showing and hiding every second I specify. Below is the code I ...

What steps can I take to stop the window/body from scrolling "through" a modal div?

Let me simplify my layout for you: <body> [... lots of content ...] <div id="modal-overlay"> </div> </body> The body has so much content that the whole page scrolls. The styling for #modal-overlay looks like this: #m ...

Prevent the sidebar from moving vertically with scrolling

I have a sidebar in my code that I found from this source. The issue I am facing is that when the content on the page becomes too long, the body scrolls but the sidebar remains static. For reference, you can view an example fiddle here. While I would lik ...

Steps for creating a clickable product item card throughout

I am looking to modify my Product Card design. Currently, there is a hyperlink named Buy at the end of the card that users can click on. However, I want to make the entire card clickable with another hyperlink so users do not have to specifically click on ...

When generating dynamic text boxes, a new area is always allocated for each new set of dynamic text boxes that are created

<html> <head> <script src="jquery-1.10.2.min.js"></script> <script> function AddingTextBoxes() { var NumOfText=$("#NumOfTextBoxes").val(); $('#NewlyCreatedSe ...

Notification fails to display following POST request

Whenever the select menu displays "Please select your country" and I click the checkout button, an alert pops up. But if I select Canada, then go back to selecting "Please select your country" and press checkout, no alert appears. I need the alert to alway ...

Adjusting text alignment to span the entire width with consistent automatic spacing

Imagine if I have a collection of N words. To illustrate, consider the following: Dog Peanut Oranges Lemon Disciplinary All these words vary in length. Let's assume there is a container with a variable width X (the container may adjust its size ac ...

Guide on how to incorporate an external javascript file into an HTML button

I am currently working on an exercise through Udacity that involves creating an HTML form with JavaScript functions. The task is to input text into the form, submit it, and have it displayed on the webpage within a blue square. This exercise is designed to ...

Firefox does not support CSS transitions

I've put in a lot of effort and even tried searching on Google, but I'm unable to find a solution to my problem: To help you understand my issue better, I have created a jsfiddle with my source code: Click here to view my Source Code Although e ...

Discovering the most recently selected element in jQuery

Currently reading a jQuery tutorial from the Head First series and practicing with an example where I need to identify the last selected element. In Chapter 2, there is a task involving four images on a page. When a user clicks on any of these images, the ...

Unexpected issue on AngularJS application

Encountering issues with incorporating a controller into my page - each time I add it to a DOM element, an error is thrown. Here's the structure of my HTML page: <html data-ng-app="sportsStore"> <head> <title>Sports Sto ...

What is the best way to transfer a user-generated PNG file to my backend server?

I'm in the process of developing a website that enables users to generate personalized graphics and easily download them directly from the platform. My approach involves allowing users to customize an svg using a javascript-powered form, which is the ...