• How do I run plugin using functions.php instead of putting it into plugins folder?

    Code below works for some plugins:
    require_once (TEMPLATEPATH . '/includes/some/path/to/plugin/plugin.php');
    but if I try to load plugins with multiple php files it causes error.

    I just want to move all the plugins to theme directory and make them load automatically when the theme is loaded.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The reason why it fails for plugins with multiple php files is because some of those other php files will be referencing each other from the plugins folder and they will not be present.

    Have you thought about putting them in the mu-plugins folder? That way they will run automatically without the need for activation.

    Thread Starter flow01

    (@flow01)

    I’d like to include plugin with WordPress theme. It rather has to be inside theme’s directory to make it easier for people who download the theme.

    Some plugins load just fine but I’m having problems with one that has several files. Is there any WordPress function to load it? Like activate_plugin or something like that?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Calling plugin from functions.php’ is closed to new replies.