Return to Snippet

Revision: 66950
at July 24, 2014 23:23 by razvanstavila


Initial Code
function projectname_font_url() {
	$font_url = '';
	/*
	 * Translators: If there are characters in your language that are not supported
	 * by Lato, translate this to 'off'. Do not translate into your own language.
	 */
	if ( 'off' !== _x( 'on', 'Lato font: on or off', 'projectname' ) ) {
		$font_url = add_query_arg( 'family', urlencode( 'Lato:300,400,700,900,300italic,400italic,700italic' ), "//fonts.googleapis.com/css" );
	}
 
	return $font_url;
}
 
function projectname_scripts() {
	wp_enqueue_style( 'projectname-lato', projectname_font_url(), array(), null );
}
add_action( 'wp_enqueue_scripts', 'projectname_scripts' );
 
function projectname_admin_fonts() {
	wp_enqueue_style( 'projectname-lato', projectname_font_url(), array(), null );
}
add_action( 'admin_print_scripts-appearance_page_custom-header', 'projectname_admin_fonts' );

Initial URL

                                

Initial Description
Add Google Lato Font link from Google Fonts to your website. It will add to your admin area also.

Initial Title
Wordpress - Add Google Fonts to Wordpress and Admin Header

Initial Tags
wordpress

Initial Language
PHP