(repost from Theme Hybrid Community)
Let’s assume a plugin or multiple-plugins are hosted on WordPress.org. Can you automatically activate plugins with the functions.php of a child theme? Is there any problem with doing such a thing?
What’s the best way to add plugin functionality to a child theme?
include this function in your theme and use this hookfunction
functions and examples:
for more information see this post
While this is quite possible technically I think this is poor workflow. Basically there are two cases here:
Theme entirely cannot function without specific plugin(s). I think it is unwanted case overall and if absolutely required it makes sense to port plugin’s functionality into theme itself.
Theme makes use of plugins for advanced features. It is not hard to detect if plugin is running (
is_plugin_active()
,function_exists()
, etc) and conditionally run code or notify that specific feature uses plugin and not natively available.