0

I don't want to ask the user to install this and that plugin, I want my theme to be 100% active active without the need to install a plugin like wp-postviews plugin, so how can i do that. I want to include it directly in functions.php file? Thanks in advance.

1

That was so easy! I just included the plugin folder in my theme Then i included it.

 include(your-theme-path . 'wp-postviews/wp-postviews.php');

That was it!

0

You could include the particular plugin in your theme directory and then fire a function on after_switch_theme:

add_action( 'after_switch_theme', 'fwp_theme_setup' );
function fwp_theme_setup(){ 
    require_once($_SERVER['DOCUMENT_ROOT'].'/wp-admin/includes/plugin.php');
    activate_plugin('your-theme/plugin-dir/plugin.php');
}

You should also take a look at after_setup_theme always runs

  • Thanks for taking the time, but it doesn't work, I found a solution though, you can find it in my answer below. – Rahman Sharif Feb 1 '13 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.