Skip to content

Instantly share code, notes, and snippets.

@joeyz
Created October 9, 2014 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joeyz/118976563650f1bea2a4 to your computer and use it in GitHub Desktop.
Save joeyz/118976563650f1bea2a4 to your computer and use it in GitHub Desktop.
Proper way to include plugins in your WP theme
// This function loads the plugin.
function jz_load_plugin() {
if (!class_exists('Vintage_Engagement_Widget')) {
// load Vintage Engagement Widget if not already loaded
include_once(TEMPLATEPATH.'/plugins/vintage_engagement_widget.php');
}
if (!class_exists('Jewelry_Widget')) {
// load Vintage Engagement Widget if not already loaded
include_once(TEMPLATEPATH.'/plugins/jewelry_widget.php');
}
if (!class_exists('Jz_Mini_Cart_Widget')) {
// load my altered mini cart widget
include_once(TEMPLATEPATH.'/plugins/jz-mini-cart.php');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment