Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

olyma on "Turning Off Open Sans for the 3.8 Dashboard"

$
0
0

I’m looking for a way to turn off the Open Sans font in the admin. I’m already using the code below to force the admin area to use a different font:

function betterfonts1() {
?>
<style type="text/css">
body {font-family: Times New Roman,Times;}
</style>
<?php
}
add_action( 'admin_head', 'betterfonts1' );

This works really well, but the Open Sans is still being called in the header. It looks like this in the header:

<link rel='stylesheet' id='open-sans-css' href='//fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext&ver=3.8' type='text/css' media='all' />

For efficiency I’d like to have the call be turned off completely. I’ve tried the following bit of code:

function removeopensans() {
	wp_deregister_style( 'open-sans' );
}
add_action( 'admin_enqueue_scripts', 'removeopensans' );

And this works, but it completely removes the stylesheet so there is zero styling for all of the admin. I’ve also fiddled with the core file script-loader.php by commenting out line 634:

// $open_sans_font_url = "//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=$subsets";

Commenting out this bit of the core file does the trick. It turns off the open sans font call in the header but keeps the general admin styling. Is there a way to turn off the open sans font in the admin without fiddling with core files?


Viewing all articles
Browse latest Browse all 8245

Trending Articles