enqueue ie conditional js after autoptimize js (all in footer)
-
Autoptimize works perfectly with the exception of a problem in IE8. placeholdr.js is required by ie8 for forms and must execute after the autoptimize combined footer js, but it currently appears (bracketed by IE conditionals) before the autoptimize combined footer js.
Sections of the relevant enqueue statements appear below
How can I change the order?
Thanks,
Brian
Since I need a lower level of jquery, I dequeue the standard version:function pp_jquery_enqueue() { wp_deregister_script('jquery'); wp_register_script('jquery', get_template_directory_uri() . '/assets/js/vendor/jquery-1.9.1.min.js', array(), null, true); wp_enqueue_script('jquery'); } if (!is_admin()) add_action("wp_enqueue_scripts", "pp_jquery_enqueue", 0);
The relevant statements from the enqueue portion of functions.php:
function pp_scripts() { ... wp_register_script('placeholdr', get_template_directory_uri() . '/assets/js/vendor/placeholdr.min.js', array('jquery'), null, true); ... wp_enqueue_script('placeholdr'); ... global $wp_scripts; $wp_scripts->add_data('placeholdr', 'conditional', 'lt IE 9'); } add_action('wp_enqueue_scripts', 'pp_scripts', 1);
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘enqueue ie conditional js after autoptimize js (all in footer)’ is closed to new replies.