How to activate plugins automatically in the theme WordpressMu? - wordpress

How can I activate plugin using function.php? so when the theme is activated, it will also activate specific plugins. thanks

#me Quite Simple
require_once('path../wp-admin/includes/plugin.php');
activate_plugin($plugin_path); // Activate Plugin

You can include() the plugin's main php file, but you may have some problems with some of the plugin's hooks so beware :)

Related

Will Wordpress updates overwrite code I customised?

I use a Wordpress theme that I have customised a lot.
If I update Wordpress or the theme that I'm using, will it overwrite the code I customised in the theme or Wordpress system?
Or can I just update everything.
Same with Wordpress plug-ins: I've written some extra code in the Woocommerce's cart script. If I update WooCommerce, will it be lost or overwritten?
Yes if you update the plugins and themes, those will be overwritten and you will lose the changes you made.

Shortcode is not working in my wordpress

After I installed the demo content in wordpress. I'm not able to see the content. Instead of that, the shotcode is shown.
It could be because you haven't install or activated the plugins came with theme. If your theme use some kind of visual builder to create pages. Please install and activate that plugin.

Creating a hidden wordpress plugin

My question might sound stupid but is there any way where I can create a WP plugin which when placed in Plugins folder does not appear in WP Admin Console and WP Admins/Users can't deactivate it from UI?
What you're searching is called "must-use plugin" or "mu-plugin". An mu-plugin is a plugin that is automatically activated when you install it, and it cannot be deactivated.
Basically, an mu-plugin is like a normal plugin. The only difference is that you will install it in wp-content/mu-plugins instead of wp-content/plugins. I wrote a complete guide to mu-plugins on SitePoint if you're interested.

install theme to style wordpress admin

I am trying to figure out how to install this theme to style my wordpress admin.
Does anyone know where in the root to install these files?
http://themeforest.net/item/avenxo-responsive-angularjs-html-admin/11660185
Thanks
First of all there are two ways of making a WordPress Admin themee: with a Plugin or by simply changing the CSS.
In this case, it recomended to make a new plugin because Angular Js needs more file js to works fine. Then this file js must be included in the core of wordpress.
Here is an example to init and activate a new plugin in wordpress:
<?php
/*
Plugin Name: My Admin Theme
Plugin URI: http://example.com/my-crazy-admin-theme
Description: My WordPress Admin Theme - Upload and Activate.
Author: Ms. WordPress
Version: 1.0
Author URI: http://example.com
*/
function my_admin_theme_style() {
wp_enqueue_style('my-admin-theme', plugins_url('wp-admin.css', __FILE__));
}
add_action('admin_enqueue_scripts', 'my_admin_theme_style');
add_action('login_enqueue_scripts', 'my_admin_theme_style');
?>
I hope this help,
best regards
Please consider to give a look at WordPress Codex. Note the answer by #Stefano Tux points you to the right direction.
Hope this helps

How to remove WooCommerce plugin dependency from Wootique theme?

How to remove WooCommerce plugin dependency from Wootique theme? When I activate Wootique theme and click on "visit site" in wordpress it shows a message "WooCommerce must be installed".
actually, You can't!
you must have to install "WooCommerce plugin", if you are using this Theme,
because the theme's source code is referring to WooCommerce plugin's functionality for displaying category wise products.
see here for details
hope this will help you
There should be a php if ( function_exists('woo-something') call in the functions.php file. Look into it, that's how wordpress themes check for installed products.
You may resolve it easily or may have to do some serious editing, I can't say since I don't have the theme.

Resources