Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WordPress 3.8 - replace admin Open Sans font with your own version
function replace_open_sans() {
// Kill the original style
wp_deregister_style('open-sans');
// Replace it with your own (just as an example, I included only the 300 weight)
wp_register_style( 'open-sans', 'http://fonts.googleapis.com/css?family=Open+Sans:300' );
wp_enqueue_style( 'open-sans');
}
add_action( 'wp_enqueue_scripts', 'replace_open_sans' );
// Thanks to @timkinnane
add_action( 'admin_enqueue_scripts', 'replace_open_sans' );
@timkinnane

This comment has been minimized.

Copy link

@timkinnane timkinnane commented Jan 24, 2015

Thanks for this!
I found I needed to use the following to replace it in dashboard AND the admin bar.

add_action( 'admin_enqueue_scripts', 'replace_open_sans' );
add_action( 'wp_enqueue_scripts', 'replace_open_sans' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment