• Resolved andym33

    (@andym33)


    Hello, I am a newbie in web design.

    I am looking to add a couple of css files, one of them to make a lot of admin css changes. I currently have the following in an mu plugin file:

    add_action('login_head', 'custom_admin');
    add_action('admin_head', 'custom_admin'); 
    
    function custom_admin() {
       echo '<style type="text/css">
          /*all my admin css code here*/
       </style>';
    }

    However, would anyone be able to tell me if it would be better and faster on page speeds to do a link to a custom css file by my functions.php. something like (not tested):

    function custom_admin(){
       echo '<link rel="stylesheet" type="text/css" href="link-to-my-stylesheet.css"/>'
    }
    
    add_action('login_head', 'custom_admin');
    add_action('admin_head', 'custom_admin');

    I would much prefer this way also as I can see the css color codes.

    Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add css file by link or mu plugin?’ is closed to new replies.