Fancy Box and Booking Calendar – JQuery conflict in WordPress

I updated the Booking Calendar plugin on my WP site. It wasn’t working due to an error with a script, and I fixed it using this solution: http://wpbookingcalendar.com/faq/loading-jquery-twice/

Problem is, editing out that line makes FancyBox not work anymore. I have updated FancyBox and JQuery Files, but still have the same problem: I have to choose between the Booking Calendar or the FancyBox to work, editing in or out that call to Jquery.

Read More

This is how the header of the page looks now. Is there anyway I can make both things work at the same time?

Thanks!

    <?php if ( is_page('Booking Calendar Name') ) { ?><?php wp_head(); ?><?php } ?>

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<!-- <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery-1.8.3.min.js"></script> -->

<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.flow.1.2.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.form.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/init_form.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/init.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/easySlider1.5.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/dropdowns.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/fancybox/jquery.mousewheel-3.0.6.pack.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/fancybox/jquery.fancybox.js"></script>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/fancybox/jquery.fancybox.css" media="screen" />

Related posts

Leave a Reply

1 comment

  1. Without being able to view the source code on your site, it’s hard to tell but what @JFK points out makes me think that there is no jQuery on your site unless you’re on the page that utilizes the Calendar plugin. In either case, I would try de-registering the script and loading the one you want via your functions.php like this:

    wp_deregister_script('jquery');
        if(!is_admin()) { 
        wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js');
        wp_enqueue_script('jquery');
    }
    

    You can remove the jQuery that is in your header since it will be loaded here instead.