Tag Info

Hot answers tagged

4

Just a few notes on your code You should dequeue and deregister a script to remove it completely from the $wp_scripts global You should not be using wp_print_scripts, this is the wrong hook. You should be using wp_enqueue_scripts Don't wrap your action in a conditional. Your conditional tag might either be set to early or to late and might cause unexpected ...


1

Why are you manually controlling Plugin's javascript files? 1) It's never bad practice to do things like they are supposed to be. That way, when you need to, it's not a mountain to climb. 2) If you're sick and I'm hired to look at your code, I expect javascripts and css to be loaded the proper way. Pasting them in the will only cost me more time and ...


1

Masonry is already registered by WordPress. From wp-includes/script-loader.php: // Masonry v2 depended on jQuery. v3 does not. The older jquery-masonry handle is a shiv. // It sets jQuery as a dependency, as the theme may have been implicitly loading it this way. $scripts->add( 'masonry', "/wp-includes/js/masonry.min.js", array(), '3.1.2', 1 ); ...


1

Scripts and styles get output with wp_head and wp_footer functions. If you enqueue a style after wp_head, it will be output in wp_footer, which, while in practice will often work, means the theme's html will not validate. It's up to you (or whomever is building a theme/plugin) to enqueue styles early enough to be output in the head. All the data you'd need ...



Only top voted, non community-wiki answers of a minimum length are eligible