'For some reason the dropdown only works when loged in as Wp-Admin

As the title says, i have a navbar with a dropdown menu - that works perfect when logged in as wp-admin. But when i enter the site as a normal guest, the dropdown doesnt work.

How is this possible? Anyone have any knowledge in the matter?

Quick help would be awesome.

Link to site -> https://venturelegal.se/



Solution 1:[1]

You could add the CSS and JS of Bootstrap like this:

function bootstrap_scripts() {
    /* Bootstrap CSS */
    wp_enqueue_style('bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', array(), '4.1.0');

    /* Bootstrap JS */
    wp_enqueue_script('bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array( 'jquery' ), '4.1.0',  true);
}
add_action('wp_enqueue_scripts', 'bootstrap_scripts');

Make sure, that the path to the JS and CSS file is inside the /css/ and /js/ folder of your theme or change the path in the code.

And you could change the Bootstrap version from 4.1.0 to your version

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Cray