Skip to content

Instantly share code, notes, and snippets.

@Japh
Last active January 8, 2017 14:09
Show Gist options
  • Save Japh/5147438 to your computer and use it in GitHub Desktop.
Save Japh/5147438 to your computer and use it in GitHub Desktop.
<?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