Advertisement
Guest User

Untitled

a guest
Apr 4th, 2014
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. add_action('wp_enqueue_scripts', function() {
  2.     // get protocol used by current page
  3.     $protocol = is_ssl() ? 'https' : 'http';
  4.  
  5.     // build list of font families to add
  6.     $font_families = array();
  7.     $font_families[] = 'The+Girl+Next+Door:400';    // only has normal/400
  8.  
  9.     // build arguments list for Google Fonts
  10.     $fonts = array(
  11.         'family' => implode('|', $font_families),
  12.         'subset' => 'latin,latin-ext',
  13.     );
  14.  
  15.     // enqueue the stylesheet
  16.     wp_enqueue_style('website-fonts', add_query_arg($fonts, "$protocol://fonts.googleapis.com/css" ), array(), null);
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement