Created
March 2, 2015 19:28
-
-
Save romuloctba/b7605729a7de4eabfd01 to your computer and use it in GitHub Desktop.
Enqueue and add javascript to wordpress themes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function loadScripts() { | |
wp_register_script( 'main', get_template_directory_uri() . '/js/main.js', array( 'jquery' ) ); | |
wp_enqueue_script( 'main' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'loadScripts' ); | |
//don't even bother to close the php tag! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment