Created
August 7, 2012 21:12
-
-
Save asimpson/3289411 to your computer and use it in GitHub Desktop.
The proper way to include a script/stylesheet in Wordpress functions.php - wrote this to call from ST2 via fetch
This file contains 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 adam_load_scripts(){ | |
wp_register_script( 'handle', get_template_directory_uri()."path", array('dep'), 'ver', 'footer?'); | |
//to add a stylesheet, change all script to style except wp_enqueue_script | |
//wp_register_style( 'handle', get_template_directory_uri()."path", array('dep'), 'ver', 'media') | |
wp_enqueue_script('handle'); | |
} | |
add_action('wp_enqueue_scripts', 'adam_load_scripts'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment