Skip to content

Instantly share code, notes, and snippets.

@lots0logs
Created April 6, 2016 21:23
Show Gist options
  • Save lots0logs/2d42ed6e371c2e8fe1812d663e72f53f to your computer and use it in GitHub Desktop.
Save lots0logs/2d42ed6e371c2e8fe1812d663e72f53f to your computer and use it in GitHub Desktop.
WordPress :: Divi Theme :: Disable Default Open Sans Font
<?php
/* DON'T copy the first line (above) if your functions.php already has it.
* ---------------------------------------------------------------------- */
function et_divi_fonts_url() {
$fonts_url = '';
/* Translators: If there are characters in your language that are not
* supported by Open Sans, translate this to 'off'. Do not translate
* into your own language.
*/
$open_sans = _x( 'off', 'Open Sans font: on or off', 'Divi' );
if ( 'off' !== $open_sans ) {
$font_families = array();
if ( 'off' !== $open_sans )
$font_families[] = 'Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800';
$protocol = is_ssl() ? 'https' : 'http';
$query_args = array(
'family' => implode( '%7C', $font_families ),
'subset' => 'latin,latin-ext',
);
$fonts_url = add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" );
}
return $fonts_url;
}
@HackerChick
Copy link

oh my god, THANK YOU!!

@dhust
Copy link

dhust commented Apr 14, 2017

Hmm. Didn't work for me.

@fredfontes
Copy link

Neither for me =(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment