Last active
March 7, 2019 02:11
-
-
Save cobaltapps/9fe6c9672de78be1f6b8ba29288d8cdb to your computer and use it in GitHub Desktop.
A Freelancer helper function that simplifies the process of enqueueing Google 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
/* | |
* Example of the freelancer_google_fonts_url function | |
* with multiple Google Fonts and multiple subsets. | |
* Note that the fonts are required, but subsets are optional | |
* and only necessary if you're using non-default/custom subset | |
* (i.e.. something other than "latin"). | |
* | |
$google_fonts_url = freelancer_google_fonts_url( | |
// An array of Google fonts with their respective styles. | |
array( | |
'Saira Semi Condensed' => '400,700', | |
'Lato' => '400,400i,700,700i', | |
), | |
// An array of Google font subsets associated with the above fonts. | |
array( 'latin-ext', 'vietnamese' ) | |
); | |
/* # Custom Google Fonts | |
* Add Google fonts. | |
*/ | |
wp_enqueue_style( 'freelancer-child-fonts', $google_fonts_url, array(), FREELANCER_CHILD_THEME_VERSION ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment