Last active
August 18, 2016 22:47
-
-
Save ajithrn/0dd427ccf15368f78208 to your computer and use it in GitHub Desktop.
WordPress: 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
/** | |
* Manage google fonts of load_google_font() | |
* set GOOGLE_FONTS constant in config.php | |
* for roots.io, Sage wp theme, place this code in lib/extras.php | |
*/ | |
function load_google_fonts() { | |
if( ! defined( 'GOOGLE_FONTS' ) ) return; | |
echo '<link href="//fonts.googleapis.com/css?family=' . GOOGLE_FONTS . '" rel="stylesheet" type="text/css" />'."\n"; | |
} | |
add_action( 'wp_head', 'load_google_fonts' , 1); |
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
/** | |
* set GOOGLE_FONTS constant in lib/config.php | |
* for roots.io, Sage wp theme | |
* http://www.google.com/fonts | |
* usage: select the font you want to use from above link copy the family from the embedded code and add it to the variable | |
*/ | |
if (!defined('GOOGLE_FONTS')) { | |
// define the google fonts you want to import | |
// Manage google fonts of load_google_font() in lib/extras.php | |
define('GOOGLE_FONTS', 'Open+Sans:400,600,700,400italic|Lato:300,400,400italic,600,700'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment