• Resolved smartmeister

    (@smartmeister)


    Hi naa986,

    We recently started to use wp-colorbox on our pages and obtained an overall great result, but we also found out that the google map widget (GMW) we’ve been using for 2 years wasn’t working properly anymore.

    This widget pop up a lightbox of its own, containing a map which can be zoomed in/out , just like the real google map would do.

    Something obviously prevent this plugin to work when wp-colorbox is installed side by side with it.

    Could you recommend some things to check first, as GMW work just fine when we disable wp-color, while wp-color doesn’t seem to be affected by GMW when it’s active.

    Thanks in advance for your help.

    Fabrice

    PS: Our problem can be seen at https://www.h-poincare.fr when clicking on the google map widget on the middle left column.

    https://www.ads-software.com/plugins/wp-colorbox/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter smartmeister

    (@smartmeister)

    We managed to have both plugins (wp-colorbox and google map widget) working side by side, but we had to go down and dirty, and edit the following portion of code in google-maps-widget.php :

    static function enqueue_scripts() {
    if (is_active_widget(false, false, ‘googlemapswidget’, true)) {
    // wp_enqueue_style(‘gmw’, plugins_url(‘/css/gmw.css’, __FILE__), array(), GMW::$version);
    // wp_enqueue_script(‘gmw-colorbox’, plugins_url(‘/js/jquery.colorbox.min.js’, __FILE__), array(‘jquery’), GMW::$version, true);
    wp_enqueue_script(‘gmw’, plugins_url(‘/js/gmw.js’, __FILE__), array(‘jquery’), GMW::$version, true);
    }

    We’re still not sure what would be a more efficient / permanent fix. Obviously this trick will be overwritten after updating the plugin.

    Plugin Author Noor Alam

    (@naa986)

    So your widget also includes the colorbox library? That explains why you are having this issue. You cannot include multiple copies of the same JavaScript file on the same page.

    Thread Starter smartmeister

    (@smartmeister)

    Thanks for your help.

    If i understood correctly, my theme offer a centralized management for various javascripts files, but each plugins use its own javascript files set, and can be in conflict with each other ?

    Plugin Author Noor Alam

    (@naa986)

    If there is only one copy of the JavaScript file it should work fine. For example:

    <script type='text/javascript' src='https://www.h-poincare.fr/wp-content/plugins/wp-colorbox/jquery.colorbox.js'></script>

    But this is not good:

    <script type='text/javascript' src='https://www.h-poincare.fr/wp-content/plugins/wp-colorbox/jquery.colorbox.js'></script>
    <script type='text/javascript' src='https://www.h-poincare.fr/wp-content/plugins/custom-plugin/jquery.colorbox.js'></script>

    It usually happens when you install multiple lightbox plugins which use the same library.

    Thread Starter smartmeister

    (@smartmeister)

    Thank’s again,
    we will try to find the best compromise between the two plugins.

    Fabrice.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘lightbox conflict beetween wp-colorbox and google map widget’ is closed to new replies.