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'm building a plugin that heavily modifies the commenting section of a blog page. It think that I cannot do this in a way that works with all themes — some CSS has to be tweaked, depending on the particular theme in use.

I'd guess that in the future, the plugin will also store some data in the database. So I suppose it should be a plugin, not a theme. (?)

Hence these questions:

  1. Is it possible to in some way indicate that a plugin works with only this and that theme?

  2. And then release some fairly simlar versions of the plugin, each version tweaked for a specific group of themes?

  3. Or are plugins supposed to work well with... all themes in existance?

  4. Can you think of some solution other than per-theme-plugins and/or forking-and-modifing-existing-themes? Perhaps child themes? But, no, then it would not be possible for users-of-my-child-theme to create their own child themes?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

There is no way to bind it to a specific theme unless you contact theme authors and they link back to you at some point (on theme activation with yellow message on the top or in their admin menu etc). As you suggested yourself, a plugin is supposed to work with any theme.

Theme and plugin markets could handle this by indicating that their plugins work with their themes only but this is a corporate restriction and cannot be applied technically.

What could be do is when you release something, you could name and describe it so it's pretty much obvious (such as here - http://wordpress.org/extend/plugins/headway-views/ ). Also, in your plugin you could check for the currently activated theme (see get_current_theme ) and output some error message from within your plugin that it's inappropriate choice.

share|improve this answer
    
Thanks! I read in the headway-views FAQ that "This is a glue plugin for the Views plugin and the Headway theme", and, yes I suppose I'll do something like that then. –  KajMagnus Jun 15 '12 at 9:30
    
that's the only option without modifying others' codebase or checking inside of your plugin for the current theme as suggested above. Hope that it helps. –  Mario Peshev Jun 15 '12 at 10:12
1  
Yes checking for the current theme could be a good idea. I could bundle CSS for many different themes in one single plugin, and then, depending on the result of get_current_theme, activate different CSS. That'd make it possible to build one single plugin that works with "most" popular themes :-) –  KajMagnus Jun 15 '12 at 10:18

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.