Register jQuery – OOP WP

You are setting your script to be added at the wp_head action. jQuery, along with most other scripts, are loaded as part of the wp_enqueue_scripts action. Care to guess which of those comes first? 😉 Edit This is actually not true. jQuery is loaded as part of wp_default_scripts which does take place before wp_head I … Read more

Why Won’t my jQuery Play Nice with WordPress?

WordPress automatically loads jQuery in “no conflict” mode so that it will be compatible with other libraries. This means the $ variable isn’t used for jQuery within WordPress. Rewrite your code to use the full jQuery keyword when you begin your closure like this: jQuery(document).ready(function($) { // … other code in here }); This is … Read more

Javascript stopped working [closed]

One of your scripts doesn’t use jQuery correctly: $(document).ready(function () {} This cannot work because jQuery runs in no conflict mode in WordPress. To make it work change the script to: jQuery(document).ready(function ($) {}