Skip to content

Instantly share code, notes, and snippets.

@wireinet
Last active July 28, 2021 11:37
Show Gist options
  • Save wireinet/759a0f8ee22b2266e4a1cce6d08281d1 to your computer and use it in GitHub Desktop.
Save wireinet/759a0f8ee22b2266e4a1cce6d08281d1 to your computer and use it in GitHub Desktop.
Wordpress jquery code in file
(function($) {
//your code
})(jQuery);
// или
jQuery( document ).ready(function( $ ){
//code
});
// подключение своего jquery:
function my_jquery_scripts() {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');
wp_enqueue_script( 'jquery' );
}
add_action( 'wp_enqueue_scripts', 'my_jquery_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment