Using a different Google Web Font in a Twenty Twelve Child theme
-
OK, after some searching I’ve yet to find a clear description of how to use a different Google Font in a Twenty Twelve Child theme. I think this’d be of some use to others, so I’m surprised to not find the process already described.
Here’s what I’ve got so far:
1) Take out the call to Open Sans:
Put
function mytheme_dequeue_fonts() { wp_dequeue_style( 'twentytwelve-fonts' ); } add_action( 'wp_enqueue_scripts', 'mytheme_dequeue_fonts', 11 );
in the Child’s functions.php.
2) To call a font named “Droid Serif”:
Do I then put something like this in the child’s functions.php?
if ( 'off' !== _x( 'on', 'Droid Serif font: on or off', 'twentytwelve' ) ) { $subsets = 'latin'; /* translators: To add an additional Open Sans character subset specific to your language, translate this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language. */ $subset = _x( 'no-subset', 'Droid Serif font: add new subset (greek, cyrillic, vietnamese)', 'twentytwelve' ); if ( 'cyrillic' == $subset ) $subsets .= ',cyrillic,cyrillic-ext'; elseif ( 'greek' == $subset ) $subsets .= ',greek,greek-ext'; elseif ( 'vietnamese' == $subset ) $subsets .= ',vietnamese'; $protocol = is_ssl() ? 'https' : 'http'; $query_args = array( 'family' => 'Droid+Serif:400italic,700italic,400,700', 'subset' => $subsets, ); wp_enqueue_style( 'twentytwelve-fonts', add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ), array(), null ); }
Doing only these two steps kicks back an error.
3) I believe I came across something regarding place something in the child styles.css. Is that true?
Any help would be welcomed.
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Using a different Google Web Font in a Twenty Twelve Child theme’ is closed to new replies.