Skip to content

Instantly share code, notes, and snippets.

@sapegin
Created August 7, 2012 19:10
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save sapegin/3288482 to your computer and use it in GitHub Desktop.
Save sapegin/3288482 to your computer and use it in GitHub Desktop.
RequireJS in Wordpress theme
@liperuf
Copy link

liperuf commented Mar 4, 2013

i needed to deregister the default jquery instance on functions.php

if( !is_admin() ) {
  wp_deregister_script("jquery");
}

before calling it via require.js

@kaidez
Copy link

kaidez commented Apr 21, 2013

I've been working on a WP site and am currently using RequireJS to load jQuery core from wp-includes/js/jquery. But because of how WordPress works, if I install a jQuery-dependent plugin via WP-Admin later on, the plugin will install jQuery core again. The end result is that the page will have two references to jQuery. Just curious if anyone has a workaround for this? Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment