-
-
Save jquimera/f1bebd5c061753ccd1a47e6cbe9c6057 to your computer and use it in GitHub Desktop.
Enqueue Google fonts in WordPress theme
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
/** | |
* Enqueue custom fonts using protocol relative URL. | |
* | |
* Syntax: wp_enqueue_style( $handle, $src, $deps, $ver, $media ); | |
* Ensure $handle is unique to prevent conflicts with plugins | |
* | |
* Note(s): The pipe (|) operator is used to load multiple typefaces in a single call. We also only load the weights we want * by comma seperating them, instead of loading every available weight. | |
*/ | |
function theme_prefix_fonts() | |
{ | |
wp_enqueue_style( 'theme-prefix-fonts', "//fonts.googleapis.com/css?family=Lora:400,700|Inconsolata:700", '', '1.0.0', 'screen' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'theme_prefix_fonts' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment