-
Notifications
You must be signed in to change notification settings - Fork 6
Hooks—Theme Assets and Meta Tags
Jo Dickson edited this page Feb 19, 2021
·
3 revisions
Hook into this filter to modify the list of font files that should be preloaded in the document head when Font Awesome (version 4 or 5) is in use.
Note that only .woff2 files are supported for preloading (don't preload .woff files or other font file types).
-
$fa_fonts
arrayArray of font file URLs.
-
$fa_version
stringThe current version of Font Awesome in use ("4", "5", "none")
array: Array of font file URLs.
Hook into this filter to modify the list of font files that should be preloaded in the document head when Cloud.Typography is not in use.
Note that only .woff2 files are supported for preloading (don't preload .woff files or other font file types).
-
$fallback_fonts
arrayArray of font file URLs.
array: Array of font file URLs.
// Adds Athena's "condensed" fallback font to the list of fonts to preload
function preload_custom_fallback_fonts( $fallback_fonts ) {
$fallback_fonts[] = UCFWP_THEME_FONT_URL . '/ucf-condensed-alt/ucfcondensedalt-regular-webfont.woff2';
return $fallback_fonts;
}
add_action( 'ucfwp_preload_athena_fallback_fonts', 'preload_custom_fallback_fonts' );