how to identify a multisite installation
The most obvious choice would be the is_multisite() conditional template tag. Used as such: if ( is_multisite() ) { // Multisite is enabled; // do something }
The most obvious choice would be the is_multisite() conditional template tag. Used as such: if ( is_multisite() ) { // Multisite is enabled; // do something }
You’ll want to include the wp-load.php, not the wp-config.php. Depending on how you’re doing it, you may also have to set $_SERVER variables if they aren’t already set to prevent WordPress from trying to redirect you. For example: $_SERVER = array( “HTTP_HOST” => “http://example.com”, “SERVER_NAME” => “http://example.com”, “REQUEST_URI” => “https://wordpress.stackexchange.com/”, “REQUEST_METHOD” => “GET” );
Have you considered setting your main site to a multisite setup? This would allow you to use the same wordpress files from the root and serve a wordpress site under the /seperatesite/ directory without the need for duplicating files. take a look at: http://codex.wordpress.org/Create_A_Network If you need any specific help regarding setting this up then … Read more
BuddyPress is compatible with a WordPress Multisite setup. There are several different ways to set it up. By default, BuddyPress data is stored in a networkwide way. Generally, that means that, within the network of sites, only one site is dedicated to BuddyPress features/content – you might think of this as the “community” site within … Read more
There’s really great WordPress codex article Before You Create A Network, “Do you really need a network?” part will answer most of your questions.
Problem is that the function you use run after http header are sent, so it can’t redirect. You have to use another way. One method can be intercept the global menu variable and add a new menu item with all properties: add_action( ‘admin_menu’, ‘register_web_menu_page’, 999); function register_web_menu_page () { global $menu; $menu[9] = array ( … Read more
The Problem: When wp-cron.php is called, it includes only: require_once( dirname( __FILE__ ) . ‘/wp-load.php’ ); so the problem you are facing is that wpmu_delete_blog() is undefined when you call it from your remove_blogs_daily() function. Possible Solution: You therefore need to add this line: require_once( ABSPATH . ‘wp-admin/includes/admin.php’ ); into your code to fix that. … Read more
What you are looking for is a “MU-Plugin”– “Must-Use Plugin”.. Originally these were called “Multi-User Plugins” and were intended for exactly your purpose– to provide a way for site admins to enable functionality on all sites of an installation. Create a directory at /wp-content/mu-plugins/ and put your PHP file(s) in it. WordPress will load the … Read more
You can disable certain themes in your WordPress network. Go to http://www.yournetwork.com/wp-admin/network/themes.php click on ‘network disable’ to hide the themes for the other websites. You can enable a theme for a single site by searching for the site -> click on ‘themes’ -> click enable at the desired theme. Hope this helps.
You can check existing user with “username_exists” WordPress function and insert user using “wp_insert_user” function as below for Network site also: if( username_exists( ‘username’ ) ) { _e( ‘Username already exists’, ‘your-text-domain’ ); } else { _e( ‘Username does not exists.’, ‘your-text-domain’ ); $userdata = array( ‘user_login’ => ‘username’, ‘user_url’ => ‘http://example.com’, ‘user_pass’ => wp_generate_password(), … Read more