Skip to content

How to add CSS code to admin dashboard via Child Theme

Style the WordPress admin dashboard itself — not the front end — by printing your own CSS into the admin head from the Vehica child theme, so the change survives theme updates.

1 minute read

Custom CSS added for your site's front end does not reach the WordPress admin dashboard. To restyle something in the admin — the H1 page title marked below, for example — the CSS has to be printed into the admin head instead.

WordPress admin dashboard with the "Dashboard" page title outlined in green and a green arrow pointing to it; the left menu shows Demo Importer, Vehica Panel, Vehicles and Vehica Updater.

Add the function below to the functions.php file of your Vehica Child Theme. You can put your own custom CSS inside it — the example changes the h1 main heading to a font size of 100px:

Use the child theme
Put the function in the child theme's functions.php, not in the parent Vehica theme. Only then does the change stay in place after a theme update.
functions.php
function admin_style() {echo '

<style>
h1 {
font-size:100px!important;
}
</style>

';
}
add_action( 'admin_head', 'admin_style' );

The final effect:

The same dashboard after the CSS is applied: the "Dashboard" heading now runs across the whole top of the page in oversized type, pushing the "Welcome to WordPress!" panel down.

Ask the people who build Vehica

We answer by email from support@tangiblewp.com. With Premium Support, we also fix your site when something breaks.

Was this guide helpful?