Code Snippets

Load Google Fonts

add_action( 'wp_enqueue_scripts', 'webendev_load_google_font' );
/**
* Enqueue Google Fonts
*
* @author Greg Rickaby
* @since 1.0
*/
function webendev_load_google_font() {
$protocol = is_ssl() ? 'https' : 'http';
$query_args = array(
'family' => 'Oswald|Open+Sans' // Change this to whatever font you'd like
);
wp_enqueue_style( 'child-fonts', add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ), array(), null );
}
view raw functions.php hosted with ❤ by GitHub