Return to Snippet

Revision: 80643
at March 23, 2020 17:24 by chrisaiv


Updated URL
https://www.chrisjmendez.com/2014/09/19/wordpress-replace-a-themes-google-font-with-your-own/

Updated Code
https://www.chrisjmendez.com/2014/09/19/wordpress-replace-a-themes-google-font-with-your-own/

Updated Description
https://www.chrisjmendez.com/2014/09/19/wordpress-replace-a-themes-google-font-with-your-own/

Revision: 67412
at September 19, 2014 03:31 by chrisaiv


Initial Code
/** ******** ******** ******** ******** ******** ******** ******** ******** 
* TITLE:        Add Font
* DESCRIPTION: Add Specific Google Font
*/

function add_fonts() {
	// Styles Format:  wp_enqueue_style($handle, $src, $deps, $ver, $media);
        wp_register_style('open-sans', 'http://fonts.googleapis.com/css?family=Bree+Serif:400,300,700', array(), false, 'all');
        wp_enqueue_style( 'open-sans');
}
add_action('wp_enqueue_scripts', 'add_fonts', 100);

Initial URL

                                

Initial Description
You like a theme but it's referencing a Google font you want to switch out. Here's the simplest way to do it, by keeping the .class names but switching out the Google Font URL

Initial Title
Wordpress: Replace a theme's Google font with your own

Initial Tags
wordpress

Initial Language
PHP