Pull Custom /wp-admin/css for Non-Admin in Multisite

Something like the following should work: global $blog_id; if ($blog_id == 1) { wp_enqueue_style( ‘custom-style’, ‘/wp-content/css/new_styles.css’ ); } Basically it checks if the person is on blog_id 1 and then loads the respective CSS from the CSS folder (you would need to create this). This would go in your functions.php

Certain functions are undefined when called form mu-plugins

Thanks to diggy from StackOverflow I’ve foudn that in the WordPress cycle, the file vars.php (containing my needed functions) is included after muplugins_loaded executes. Including wp_is_mobile() and current_user_can() in wrapper functions fixed my problem. CORRECT function my_epic_function() { if(current_user_can( ‘edit_posts’ )) { if(!wp_is_mobile()) { //code to be executed } } } add_action(‘init’, ‘my_epic_function’); INCORRECT function … Read more

is_main_site() Always Returns True

I am not calling it inside of a hook but just straight away as the first thing in a MU plugin. At that point all the info you are requesting won’t be available. That’s running before any hook and before WP is fully loaded. Use a hook like wp_loaded, admin_init, after_setup_theme … whatever serves your … Read more

WordPress Multisite – Load users using custom query

In following to my comments on the question the follow examples for a solution. Default Function WordPress have the function get_users to get all users for each site, works on single or multisite area. But to get all users from each site in Multisite network is the switch to each site important. The follow example … Read more