Title: Theme specific plugin
Last modified: August 20, 2016

---

# Theme specific plugin

 *  [zeaks](https://wordpress.org/support/users/zeaks/)
 * (@zeaks)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/theme-specific-plugin/)
 * Is there a way to disable a plugin for all themes other than one specific theme?

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

 *  [Marventus](https://wordpress.org/support/users/marventus/)
 * (@marventus)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/theme-specific-plugin/#post-2242316)
 * Hi zeaks,
 * you should try:
    `deactivate_plugins()` and activate_plugins()`. Frist, try disabling
   the plugin in question from the WP admin panel, and insert this in the functions.
   php file of the theme you want to enable that plugin: `activate_plugins( '/plugin-
   folder/plugin-name.php' );`
 * If that doesn’t work, try the opposite, i.e., enable the plugin globally and 
   disable it in each of the themes by inserting this line in the `functions.php`
   files:
    `deactivate_plugins( '/plugin-folder/plugin-name.php' );`
 *  Thread Starter [zeaks](https://wordpress.org/support/users/zeaks/)
 * (@zeaks)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/theme-specific-plugin/#post-2242335)
 * Thanks Marventus, I don’t have the option for adding code to the theme though.
   I’m creating a plugin for a specific theme, that will only work with that theme,
   so I’d like for it to auto-disable itself if that certain theme is not active.
 *  [Marventus](https://wordpress.org/support/users/marventus/)
 * (@marventus)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/theme-specific-plugin/#post-2242337)
 * You can use the `get_current_theme` function:
    `http://codex.wordpress.org/Function_Reference/
   get_current_theme` You might also want to check out other theme-specific plugins
   to see how the authors proceeded, and give them credit where due. Good luck!

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

The topic ‘Theme specific plugin’ is closed to new replies.

 * 3 replies
 * 2 participants
 * Last reply from: [Marventus](https://wordpress.org/support/users/marventus/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/theme-specific-plugin/#post-2242337)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
