To integrate custom plugins in custom themes
-
Hello!
I’ve created a custom theme, and I’ve my self plugins, but I need install and activate one with my theme, and I son’t know to do it, I’ve this in my functions.php (I put as example hello dolly because is very simple):
add_action(‘after_setup_theme’, ‘load_MyPlugin’);
function load_MyPlugin() {
// if (!class_exists(‘MyPluginClass’)) {
include_once(WP_PLUGIN_DIR . ‘/plugins/hello-dolly/hello.php’);
require_once($_SERVER[‘DOCUMENT_ROOT’].’/wp-admin/includes/plugin.php’);
activate_plugin(‘hello-dolly/hello.php’);
// }
}
This code no works…
Someone can help me?? 🙂
thanks!
Viendo 1 respuesta (de un total de 1)
Viendo 1 respuesta (de un total de 1)
- El debate ‘To integrate custom plugins in custom themes’ está cerrado a nuevas respuestas.