skip to Main Content

Add Extra Google Font Options

Important: You can now register your own fonts right via the WP admin via the exclusive Total theme Font Manager.

The following snippet can be used to add extra Google Font options or override the entire list of available Google font options available in the Customizer > Typography panel or exclusive Total theme elements.

/**
 * Register new Google font option.
 *
 * @link https://total.wpexplorer.com/docs/snippets/add-new-google-fonts/
 */
add_filter( 'wpex_google_fonts_array', function( $array ) {
    $array[] = 'Rubik';
    return $array;
} );

/**
 * Override the entire Google Fonts List.
 *
 * @link https://total.wpexplorer.com/docs/snippets/add-new-google-fonts/
 */
add_filter( 'wpex_google_fonts_array', function( $array ) {
    return [ 'Open Sans', 'Roboto', 'Lobster' ];
} );
All PHP snippets should be added via child theme's functions.php file or via the Code Snippets Plugin (or alternative plugin)
Back To Top