Multisite – maximum number of users with specific role

Ok here is how I did it: add_action( ‘editable_roles’ , ‘hide_editable_roles’ ); function hide_editable_roles( $roles ){ $blog_id = get_current_blog_id(); // Get current subsite id switch($blog_id) { // Define different max agents numbers depending on subsite id case 6: $max_agents = 10; //for subsite id#6 we can have maximum 10 agents break; case 7: //for subsite … Read more

multisite (MU) Subdomain- only one wordpress install

Your problem is not a WordPress problem, but a server setup problem. WordPress is perfectly capable of handling the requests to the subdomains, but those requests never reach WordPress. Your server is not configured to map those subdomains on to your WordPress install. That’s why you get the placeholder, as that’s what your server is … Read more

How to wordpress multi site [closed]

I think to explain it all here is a bit beyond the scope. Perhaps it is best to start here, and then you can ask detailed questions if you encounter problems:https://www.wpbeginner.com/wp-tutorials/how-to-install-and-setup-wordpress-multisite-network

How to exclude specified from all list of Multisite

I’d recommend using get_sites() instead of crafting $wpdb calls. Add this code to your theme’s functions.php file. function wpse365255_print_sites() { $args = array( ‘number’ => 10000, // if you’ve got more than 10,000 sites, //you can increase this ‘public’ => 1, ‘spam’ => 0, ‘deleted’ => 0, ‘archived’ => 0, ‘site__not_in’ => array( 1, 2 … Read more

Display site description instead of site name

get_blog_option() return blog info by supplying blog id and blog option name. So you may try changing the blog name variable from $details->blogname to get_blog_option( $site->blog_id, ‘blogdescription’) in the loop Becauae get_blog_details() does not add the description from option to its output object. So it let is needed to manually fetch additional information. By default, … Read more

How to WP_Query() from multiple blogs and order them?

You can’t switch in different blogs of the network with the switch_to_blog([1,2]); function. The function needs a clearly integer value for one blog, see documentation. WP Core This process should help you. A custom way with the help of the WP core. // The sites IDs $sitesObj = get_sites([ ‘site__in’ => [1, 2,] ]); // … Read more