How To Add Extra Google Font In Your Website?

X

Litho provides two Google fonts settings. If you want to load more Google fonts settings, please add below custom PHP code in your child theme to have extra Google fonts that can be loaded with one Google font request.

You can only select only two fonts i.e. main font & additional font from the theme settings. Using below code in your custom CSS, you can add new fonts in the child theme.

To add below custom PHP code, open functions.php file from your child theme directory and insert below code.

In below example code two fonts are font names that you can change with desired font name or font name that you want to use. You can also add font weights like 100,200… etc. If you want to add more fonts then you just need to add additional row code as below;

$fonts[] = ‘Muli:100,200,300,400,500,600,700,800,900’;

if( ! function_exists( 'litho_child_google_font' ) ) {
	function litho_child_google_font( $fonts ) { 
	 
		$fonts[] = 'Sacramento:100,200,300,400,500,600,700,800,900'; 
		$fonts[] = 'Muli:100,200,300,400,500,600,700,800,900'; 
	 
		return $fonts; 
	}
}
add_filter( 'litho_google_font', 'litho_child_google_font' );
SCROLL UP