Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

wordpress add jquery script

Here is an example of how your jQuery script 
(in wp-content/themes/your-theme/js/your-scrript.js) might look:

jQuery(document).ready(function($) {
  $('#nav a').last().addClass('last');
})
Comment

wordpress add jquery script

add_action( 'wp_enqueue_scripts', 'add_my_script' );
function add_my_script() {
    wp_enqueue_script(
        'your-script', // name your script so that you can attach other scripts and de-register, etc.
        get_template_directory_uri() . '/js/your-script.js', // this is the location of your script file
        array('jquery') // this array lists the scripts upon which your script depends
    );
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript add alpha to hex 
Javascript :: angular generate component without spec 
Javascript :: how to create a random 2d vector in js 
Javascript :: npm windows shocut 
Javascript :: framer motion styled components 
Javascript :: select element by data attribute 
Javascript :: regex to match empty string 
Javascript :: .sequelizerc File Setup 
Javascript :: Set node environment through package.json script 
Javascript :: js add params to url 
Javascript :: how to setItem and getItem in javascript in localStorage 
Javascript :: sh 1 nodemon not found heroku 
Javascript :: react-native-checkbox in a loop 
Javascript :: how can auto download window print in javascript 
Javascript :: react absolute import 
Javascript :: javascript how to print working directory 
Javascript :: mongoose nullable 
Javascript :: change elements class javascript 
Javascript :: jQuery.easing[this.easing] is not a function 
Javascript :: vuejs watch sub property 
Javascript :: javascript search like 
Javascript :: how to remove 000webhost watermark 2019 
Javascript :: jquery add td to tr dynamically 
Javascript :: express static auth 
Javascript :: react scroll to top 
Javascript :: js html play beep 
Javascript :: check length of number javascript 
Javascript :: onpress image react native 
Javascript :: sticky operations in javascript 
Javascript :: status nodejs 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =