admin管理员组

文章数量:1424963

I'm developing my own Wordpress theme that I'm going to use for multiple clients. It has a Theme Options-page so I can easily customize the website every time, but I will also be using some plugins on every website I make (like an SEO-plugin, security, ...).

Is there a way to make them 'required' so I get a list of these plugins so I don't have to go find them in the plugins directory when I install the theme on a new website?

I'm developing my own Wordpress theme that I'm going to use for multiple clients. It has a Theme Options-page so I can easily customize the website every time, but I will also be using some plugins on every website I make (like an SEO-plugin, security, ...).

Is there a way to make them 'required' so I get a list of these plugins so I don't have to go find them in the plugins directory when I install the theme on a new website?

Share Improve this question asked Jun 4, 2019 at 10:02 Thessa VerbruggenThessa Verbruggen 2452 silver badges10 bronze badges 3
  • 2 You can use TGM Plugin Activation to list your theme's required plugins. tgmpluginactivation – Bhupen Commented Jun 4, 2019 at 10:08
  • 2 Why not use a repository like github or bitbucket to hold all of the common files and just clone into the new site? – disinfor Commented Jun 4, 2019 at 17:06
  • That's an option too, but i'd rather download the newest version of the plugins right away. But thanks voor the solution! – Thessa Verbruggen Commented Jun 5, 2019 at 7:25
Add a comment  | 

1 Answer 1

Reset to default 10

One way is to use TGM, as Bhupen already mentioned.

But if you want to do it in a cleaner, more "wordpressy" way, then you can:

1. Use, but don't require

You can write your theme in such way, that it doesn't require given plugins, but it uses them if they're available.

Good example of such approach is usage of WP-PageNavi plugin. You can check if this plugin is available and use it for pagination. But if it's not available, you can use native WP functions.

This way you give your user choice if he want's to use given plugin. Sometimes it's very important due to some conflicts, and so on.

2. Notify admin which plugins are recommended

And if you want to make it easier for you/user to install all recommended plugins, you can add some admin notice that will contain a list of recommended plugins. But please remember to allow to hide such notice.

本文标签: theme developmentCan I make plugins required