Code Snippet

Home » Code Snippets » WordPress » Apply Custom CSS to Admin Area

Apply Custom CSS to Admin Area

Add to the functions.php file:

add_action('admin_head', 'my_custom_fonts');

function my_custom_fonts() {
  echo '<style>
    body, td, textarea, input, select {
      font-family: "Lucida Grande";
      font-size: 12px;
    }
  </style>';
}

Subscribe to The Thread

  1. It must be in the themes functions?

  2. Azhar Kamar

    Awesome! Just what i need. ;)

  3. Hi,

    have you tried to test with an external CSS file like :

    add_action('admin_head', 'my_custom_fonts');
    
    function my_custom_fonts() {
      echo '<link rel="stylesheet" href="style.css" type="text/css" media="all" />';
    }

    Maybe it would be more practical.

    Thanks from France (sorry for my poor english) for your good ressources

  4. I agree with NicoGaudin It would be good to know whether this would work with an external stylesheet instead of embedded styles.

  5. Dhafian

    Yes! I’ll try it.. this is what I need..

Speak, my friend

At this moment, you have an awesome opportunity* to be the person your mother always wanted you to be: kind, helpful, and smart. Do that, and we'll give you a big ol' gold star for the day (literally).

Posting tips:
  • You can use basic HTML
  • When posting code, please turn all
    < characters into &lt;
  • If the code is multi-line, use
    <pre><code></code></pre>
Thank you,
~ The Management ~