Skip to content

Instantly share code, notes, and snippets.

@walterebert
Created October 27, 2015 08:45
Show Gist options
  • Save walterebert/80938bf20cdc1c126dff to your computer and use it in GitHub Desktop.
Save walterebert/80938bf20cdc1c126dff to your computer and use it in GitHub Desktop.
WordPress snippet: Make jQuery backward compatible
<?php
function my_compat_jquery() {
echo "<script>var $ = $ || jQuery;</script>\n";
}
add_action( 'wp_head', 'my_compat_jquery', 11 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment