COOKIE_DOMAIN setting confusion

As cdn.mydomain.com is not part of your WordPress network, it wont be affected by your settings. The COOKIE_DOMAIN constant should only be used if you want to serve cookies from a single domain for all your sites in the network. If you omit the constant or set it to an empty value, cookies will belong … Read more

How to disable Multisite sign-up page?

[Update] An alternative (maybe better) is to use the following constant in wp-config.php: define( ‘NOBLOGREDIRECT’, ‘http://example.com’ ); At the very beginning of wp-signup.php file there is this code: function do_signup_header() { do_action( ‘signup_header’ ); } add_action( ‘wp_head’, ‘do_signup_header’ ); So, it’s just a matter of adding the signup_header action hook to break any further execution … Read more

WP_Site_Query vs. WP_Network_Query in WordPress 4.6

When you set WordPress to multisite, in an “out of box” fashion, you create a single network of sites. Let’s, say, a network of food blogs. With plugins like WP Multi Network you can set up multiple networks. You could split that food blogs network into several networks: mediterranean food blogs, brazilian food blogs, thai … Read more

Set up collaborative site

I implemented a MU site similar to this a few years ago and there are some caveats you need to consider before going that direction. It’s helpful to think of an MU installation is a convenient way of accessing the administration of multiple, independent WordPress installations. It operates not much differently than if you installed … Read more

find a random blogid across my multisite network that has at least one post published

An example that displays an admin notice listing a randomized array with all blog IDs, the result of a get_posts( array( ‘numberposts’ => 1 ) ) and marking the first one which get_posts result is different from zero. Result After refreshing: Code add_action( ‘admin_notices’, ‘wpse_60401_print_random_blog’ ); function wpse_60401_print_random_blog() { global $wpdb; $rows = $wpdb->get_results( $wpdb->prepare( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)