Last active
January 28, 2017 20:39
-
-
Save mzalewski/acc44c0498aea7ab85e4a06efd323365 to your computer and use it in GitHub Desktop.
Adding scripts/styles to a WordPress plugin
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 myplugin_enqueue_scripts() { | |
$plugin_url = plugin_dir_url( __FILE__ ); | |
wp_enqueue_style( 'cssname', $plugin_url . 'assets/css.css', array(), '1.0' ); | |
wp_enqueue_script( 'jsname', $plugin_url . 'assets/js.js', array( 'jquery' ), '1.0' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'myplugin_enqueue_scripts' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment