Created
July 6, 2018 19:50
-
-
Save interactiveRob/608921a6248031f5fd1e1ee200cefc86 to your computer and use it in GitHub Desktop.
Basic WP enqueue scripts and Styles
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
/** | |
* Proper way to enqueue scripts and styles. | |
*/ | |
function wpdocs_theme_name_scripts() { | |
wp_enqueue_style( 'style-name', get_stylesheet_uri() ); | |
wp_enqueue_script( 'script-name', get_template_directory_uri() . '/js/example.js', array(), '1.0.0', true ); | |
} | |
add_action( 'wp_enqueue_scripts', 'wpdocs_theme_name_scripts' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment