wordpress add script js code example
Example 1: include script in wordpress
wp_enqueue_script( 'script', get_template_directory_uri() . '/js/script.js', array ( 'jquery' ), 1.1, true);
Example 2: wordpress include javascript file
function jquery_tabify() {
wp_enqueue_script(
'jquery-tabify',
'http://site.com/jquery.tabify.js',
array( 'jquery' )
);
}
add_action( 'wp_enqueue_scripts', 'jquery_tabify' );