if ( ! function_exists( 'twentysixteen_fonts_url' ) ) :
if ( ! function_exists( 'twentysixteen_fonts_url' ) ) :
/**
/**
* Register Google fonts for Twenty Sixteen.
* Register Google fonts for Twenty Sixteen.
*
*
* Create your own twentysixteen_fonts_url() function to override in a child theme.
* Create your own twentysixteen_fonts_url() function to override in a child theme.
*
*
* @since Twenty Sixteen 1.0
* @since Twenty Sixteen 1.0
*
*
* @return string Google fonts URL for the theme.
* @return string Google fonts URL for the theme.
*/
*/
function twentysixteen_fonts_url() {
function twentysixteen_fonts_url() {
$fonts_url = '';
$fonts_url = '';
$fonts = array();
$fonts = array();
$subsets = 'latin,latin-ext';
$subsets = 'latin,latin-ext';
/* translators: If there are characters in your language that are not supported by Merriweather, translate this to 'off'. Do not translate into your own language. */
/* translators: If there are characters in your language that are not supported by Merriweather, translate this to 'off'. Do not translate into your own language. */
if ( 'off' !== _x( 'on', 'Merriweather font: on or off', 'twentysixteen' ) ) {
if ( 'off' !== _x( 'on', 'Merriweather font: on or off', 'twentysixteen' ) ) {
/* translators: If there are characters in your language that are not supported by Montserrat, translate this to 'off'. Do not translate into your own language. */
/* translators: If there are characters in your language that are not supported by Montserrat, translate this to 'off'. Do not translate into your own language. */
if ( 'off' !== _x( 'on', 'Montserrat font: on or off', 'twentysixteen' ) ) {
if ( 'off' !== _x( 'on', 'Montserrat font: on or off', 'twentysixteen' ) ) {
$fonts[] = 'Montserrat:400,700';
$fonts[] = 'Montserrat:400,700';
}
}
/* translators: If there are characters in your language that are not supported by Inconsolata, translate this to 'off'. Do not translate into your own language. */
/* translators: If there are characters in your language that are not supported by Inconsolata, translate this to 'off'. Do not translate into your own language. */
if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'twentysixteen' ) ) {
if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'twentysixteen' ) ) {
$fonts[] = 'Inconsolata:400';
$fonts[] = 'Inconsolata:400';
}
}
if ( $fonts ) {
if ( $fonts ) {
$fonts_url = add_query_arg( array(
$fonts_url = add_query_arg( array(
'family' => urlencode( implode( '|', $fonts ) ),
'family' => urlencode( implode( '|', $fonts ) ),
'subset' => urlencode( $subsets ),
'subset' => urlencode( $subsets ),
), 'https://fonts.googleapis.com/css' );
), 'https://fonts.googleapis.com/css' );
}
}
return $fonts_url;
return $fonts_url;
}
}
endif;
endif;
/**
/**
* Handles JavaScript detection.
* Handles JavaScript detection.
*
*
* Adds a `js` class to the root `<html>` element when JavaScript is detected.
* Adds a `js` class to the root `<html>` element when JavaScript is detected.