I have two items that work separately, but not together. I know what the problem is, but I don’t know how to resolve it.
I have a WordPress carousel plugin that is conflicting with the script I have in the footer which is calling jquery.
<script src="<?php bloginfo('stylesheet_directory') ?>/assets/js/vendor/jquery.js"></script>
Obviously, I’m assuming the plugin is also calling for jquery, but if I remove my jquery in the footer, which is being used for the mobile nav, the collapsing nav pulldown stops working.
What is the best way to go about this? I’m not well versed with jquery.
—
UPDATE:
I finally got it working.
function pm_scripts() {
wp_deregister_script( 'jquery' );
wp_register_script('jquery',get_stylesheet_directory_uri().'/assets/js/vendor/jquery.js');
wp_enqueue_script('jquery');
/* REGISTER ALL JS FOR SITE */
wp_register_script('topbar',get_stylesheet_directory_uri().'/assets/js/foundation/foundation.topbar.js');
wp_register_script('modernizr',get_stylesheet_directory_uri().'/assets/js/vendor/modernizr.js');
wp_register_script('foundation',get_stylesheet_directory_uri().'/assets/js/foundation.min.js');
/* CALL ALL SCRIPTS FOR SITE */
wp_enqueue_script('topbar');
wp_enqueue_script('modernizr');
wp_enqueue_script('foundation');
}
add_action( 'wp_enqueue_scripts', 'pm_scripts' );
Any arguments?
Using wp_enqueue_script worked!