admin管理员组

文章数量:1191359

I have a server that uses themes from our private repository, and I'd like to auto enable the themes as soon as they exist in the wordpress themes folder.

Right now I have to login as administrator and enable the theme network-wide so the adminisrators can choose the theme.

Is there a way to configure wordpress network to AUTO enable the themes?

I have a server that uses themes from our private repository, and I'd like to auto enable the themes as soon as they exist in the wordpress themes folder.

Right now I have to login as administrator and enable the theme network-wide so the adminisrators can choose the theme.

Is there a way to configure wordpress network to AUTO enable the themes?

Share Improve this question asked Oct 14, 2017 at 14:26 TznTzn 31 bronze badge
Add a comment  | 

3 Answers 3

Reset to default 1

Unfortunately, no. For something like that to work, WordPress (or some plugin to do that) would need to scan themes folder for changes, and that can be performance intensive operation. Maybe with some sort of scheduled scan running every few minutes.

I am not aware of any plugin that can do that.

If you are adding 3 new themes per week, you mean you just want them to be network activated automically? Use-WP-cli to install and activate them or deploy them from github.

You can override the WordPress default theme by editing your wp-config.php file. Just add the following code anywhere before the line where WordPress includes the wp-settings.php file.

Add this

1:    define( 'WP_DEFAULT_THEME', 'your-default-theme' ); 

Before

2:    require_once(ABSPATH . 'wp-settings.php');

So when you will create a new subsite in multisite, it will automatically enable the theme defined in WP-CONFIG file.

If theme is not availabe it will choose defauly twentyseventeen theme.

本文标签: Wordpress MultisiteAuto enable theme