Note: I have updated this plugin with an admin interface. You can read more about the plugin on the WordPress plugin directory. The following write-up applies to version 1.0 of the plugin. Download links are available at the end of the post.
If you want to add CSS on the login pages and front-end, in addition to the Admin side, use my Custom Login Admin Front-end CSS plugin. It supports multisites as well.
I had written on how to load CSS on the admin side before. This involved adding the load function into the functions.php of the theme.
Recently a need arose where the CSS had to be loaded irrespective of the theme being used, on a multisite network. So the function took shape as a plugin and I have my first WordPress plugin up in the extend.
Admin CSS MU
Admin CSS MU simply loads a CSS file. All your custom CSS can go into that file. I think the best use case for the plugin would be as a mu plugin, since it wouldn’t probably need an update ever (and hence the MU in the name).
Installation Instructions:
To use as a normal plugin in WordPress single install and Multisite.
- Install the plugin through the WordPress admin interface, or upload the folder /admin-css-mu/ to wp-content/plugins/ using ftp.
- Move (or create) custom_admin.css to wp-content/themes/ folder. (it should look like wp-content/themes/custom_admin.css)
- Add the custom css you want into custom_admin.css.
- Activate the plugin via WordPress admin interface. If it is a Multisite, preferably Network Activate it.
To use as a Must Use (mu) plugin for WordPress single install and Multisite.
- If you don’t have already, create a folder /mu-plugins/ in /wp-content/ directory on your server. (it should look like wp-content/mu-plugins/)
- Upload the file (just the file, not folder) admincssmu.php to wp-content/mu-plugins/ . (it should look like wp-content/mu-plugins/admincssmu.php)
- Move (or create) custom_admin.css to wp-content/themes/ folder. (it should look like wp-content/themes/custom_admin.css)
- No activation is necessary. MU plugins are always active and can only be deactivated if you delete it. No auto-updates are available though.
Plugin Page | Download Ver 1.0 | Download Latest | CSS Samples
Hope you find this useful. If you like it, please give it a 5 star rating. Enjoy.
This is great. Having your custom CSS file get uploaded is awesome. Thanks Arun, really helpful for our web designers team.
So nice of you. Thanks man 🙂
This was a great plugin really nice keep up your good work,please do develop more usefull plugins.
Thanks again.
thanks a lot sharing this works well…
Thanks man, welcome 🙂
Oh! Nice plugin..thanks
worked well!!
Thanks for sharing mate!
Did you made this plugin? That’s really cool. I would love to see more of your developed plugins.
Nice plug-in! Just added it and it works like a charm! Thanks
Thanks Maadhav!
Thanks for this
Glad you found it useful.
Hi,
Thanks for this useful plugin.
Do you think is possible to apply css by users roles directly in the plugin ?
Best regards
Hello Cédric,
It’s not a feature as of now. Will take this as a feature request. Thank you for using my plugin 🙂