0

I've read about and configured my own scripts using

wp_enqueue_script

and setting my script as jQuery-dependant, but how can I reorder jQuery when the script is from a plugin?

<script type="text/javascript">
                function ytc_init_MPAU() {jQuery('.ytc-lightbox').magnificPopupAU({disableOn:320,type:'iframe',mainClass:'ytc-mfp-lightbox',removalDelay:160,preloader:false,fixedContentPos:false});}jQuery(window).on('load',function(){ytc_init_MPAU();});jQuery(document).ajaxComplete(function(){ytc_init_MPAU();});
            </script>
            <link rel='stylesheet' id='dashicons-css' href='http://elinfluencer.dosdev.com/wp-includes/css/dashicons.min.css?ver=4.8' type='text/css' media='all'/>
            <link rel='stylesheet' id='thickbox-css' href='http://elinfluencer.dosdev.com/wp-includes/js/thickbox/thickbox.css?ver=4.8' type='text/css' media='all'/>
            <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js?ver=1.12.4'></script>
3
  • 2
    Looks like you're not using the jQuery that comes with WP core. That would be your issue. Instead of dequeuing core jQuery and enqueueing a version from Google, just make your plugin script dependent on core's version of jQuery. Commented Jun 21, 2017 at 16:00
  • edit your question and share your code instead of screenshot please Commented Jun 21, 2017 at 16:06
  • @WebElaine: I'll take a look at that. This is legacy installation, not one that I created. Thank you for your input. Commented Jun 21, 2017 at 16:20

1 Answer 1

-1

Just as @WebElaine observed, jQuery was being used incorrectly and twice. I removed the external call and edited my script accordingly to use the core's version.

Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.