Last active
January 8, 2017 14:09
-
-
Save Japh/5147438 to your computer and use it in GitHub Desktop.
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 | |
/* | |
Plugin Name: Simplecart for WordPress | |
Plugin URI: http://wp.tutsplus.com/articles/how-to-include-javascript-and-css-in-your-wordpress-themes-and-plugins/#comment-827004468 | |
Description: A very simple plugin to load SimpleCart in WordPress | |
Version: 1.0 | |
Author: Japh | |
Author URI: http://wp.tutsplus.com/author/Japh | |
License: GPL2 | |
*/ | |
function simplecart_with_jquery() { | |
// Register the script like this for a theme: | |
wp_register_script( 'simplecart-script', plugins_url( '/js/simplecart.js', __FILE__ ), array( 'jquery' ) ); | |
// For either a plugin or a theme, you can then enqueue the script: | |
wp_enqueue_script( 'simplecart-script' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'simplecart_with_jquery' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment