Created
May 11, 2015 12:33
-
-
Save laurenclark/c8b5e9de80b85ae0b709 to your computer and use it in GitHub Desktop.
Dynamic Fonts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Custom | |
function font_url() { | |
$font_url = ''; | |
if ( 'off' !== _x( 'on', 'Lato font: on or off', 'foundationpress' ) ) { | |
$font_url = add_query_arg( 'family', urlencode( 'Lato' ), "//fonts.googleapis.com/css" ); | |
} | |
return $font_url; | |
} | |
function theme_styles() { | |
// Add Font | |
wp_enqueue_style( 'google-fonts', font_url(), array(), null ); | |
} | |
add_action( 'wp_enqueue_scripts', 'theme_styles' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment