How to Add Custom CSS to WordPress Admin

Spread the love

Trust it or not, I invest a terrible parcel of energy experiencing my blog’s remarks and remedying spelling issues, code arranging, and so on.;

One grumble I have with WordPress’ administrator area is that it’s hard to spot <pre> label substance, particularly code tests that are just a single line. It made me think: “wouldn’t it be wonderful on the off chance that I could add my own styles to the WordPress administrator interface?” If it’s great, I need to do it, so here’s the manner by which you can add your own particular custom styles to WordPress administrator!


admin_print_styles, woocommerce admin css, wordpress add admin stylesheet, wordpress admin css classes, wordpress admin css plugin, wordpress admin enqueue style, wordpress admin style guide, wordpress css plugin

Step 1: Create Your CSS File

You can place the CSS file wherever you’d like; I’ve chosen to place the CSS file within my theme. My admin CSS file looks like:

The CSS above makes <pre> tags more visible.  It also will make any PRE element without a class more apparent, teling me I need to fix it by adding the language as a className.

Step 2: Add Your CSS to WordPress Admin in functions.php

WordPress uses an add_action type of admin_enqueue_scripts for adding stylesheets anywhere within WordPress:

get_template_directory_uri provides the path to your current theme, you simply need to add the filename to the end of the path.

Thats All !

Leave a Reply

Your email address will not be published. Required fields are marked *