• I have included the following codes,

    <?php wp_enqueue_script(“jquery”); ?>
    <?php wp_head(); ?>

    in header.php

    ————————————

    <?php wp_footer(); ?>
    in footer.php and
    ————————————

    <?php

    function wpbootstrap_scripts()
    {
    wp_enqueue_script( ‘application’, get_template_directory_uri() . ‘/js/application.js’ );
    wp_enqueue_script( ‘bootstrap-collapse’, get_template_directory_uri() . ‘/js/bootstrap-collapse.js’ );
    wp_enqueue_script( ‘bootstrap-tab’, get_template_directory_uri() . ‘/js/bootstrap-tab.js’ );
    wp_enqueue_script( ‘bootstrap-transition’, get_template_directory_uri() . ‘/js/bootstrap-transition.js’ );
    wp_enqueue_script( ‘bootstrap.min’, get_template_directory_uri() . ‘/js/bootstrap.min.js’ );
    wp_enqueue_script( ‘owl.carousel’, get_template_directory_uri() . ‘/js/owl.carousel.js’ );
    wp_enqueue_script( ‘script’, get_template_directory_uri() . ‘/js/script.js’ );
    }
    add_action( ‘wp_enqueue_scripts’, ‘wpbootstrap_scripts’ );

    ?>
    —————————————————–
    the javascript files are located in a folder called js which is located where header.php is. I don’t understand why this is not working.

    Any help will be much appreciated, thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    What shows up in your browser’s console log?

    Thread Starter shru94

    (@shru94)

    it says
    ” $ is not defined ”

    Hi shru94,

    In which file have you write this function?
    function wpbootstrap_scripts()

    and which theme are you using?

    I have used your defined code in my localhost and it is working absolutely fine. Please check your theme and function again maybe you are missing something to add here.

    Thanks,
    Sami

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Local Host JavaScript now working’ is closed to new replies.