Created
August 10, 2018 14:31
-
-
Save Nikschavan/92bfd7f95ca882f2cce91c1877751d9c to your computer and use it in GitHub Desktop.
Load Extra font variants in Astra Google Fonts.
This file contains 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
<?php // don't copy this line in your code | |
/** | |
* Load extra font weights in Astra Google fonts. | |
* This example loads extra variannts for the Open Sans font. | |
* | |
* @param Array $fonts Fonts selected in customizer. | |
* @return Array Fonts array updated with more font variants to be loaded. | |
*/ | |
function your_prefix_astra_more_font_weights( $fonts ) { | |
if ( isset( $fonts["'Open Sans', sans-serif"] ) ) { | |
$fonts["'Open Sans', sans-serif"] = array( '400', '400i', '700', '700i' ); | |
} | |
return $fonts; | |
} | |
add_filter( 'astra_google_fonts', 'your_prefix_astra_more_font_weights' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment