Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a couple of pluins which I use every time I create a new WP-page. Is there a way to implement these plugins as part of my theme? I have searched for a soloution for a couple of hours now, without any luck - hope someone can help :)

share|improve this question

2 Answers 2

up vote 2 down vote accepted

First, I would recommend against it.

I have a package of plugins that I use on almost all of our websites (both public and internal plugins)... and plugins should really remain plugins. Deploying a package of plugins is not hard or time consuming and only needs to be done once per project.

By integrating them into a theme, you lose the ability to activate/deactivate them if necessary, nor can you update them. Please consider that first.

Ok, so to incorporate them into your theme, this is what you would do...

  1. Create a "plugins" folder within your theme.
  2. Place both plugins in that folder.
  3. Within your functions.php file, use require_once to load each of the plugins default php files (if the plugin authors correctly followed convention, the main plugin file will be the one that matches the plugin folder name).
  4. Done.

Please also take note that you may have problems with activation/deactivation functions... so be careful.

share|improve this answer

You can have a look at https://github.com/thomasgriffin/TGM-Plugin-Activation

TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes

And this: How to make plugin required in a wp theme without using php conditional statements when calling an individual function from that plugin?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.