Posted By

chrisaiv on 09/19/14


Tagged

wordpress


Versions (?)

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


 / Published in: PHP
 

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

  1. /** ******** ******** ******** ******** ******** ******** ******** ********
  2. * TITLE: Add Font
  3. * DESCRIPTION: Add Specific Google Font
  4. */
  5.  
  6. function add_fonts() {
  7. // Styles Format: wp_enqueue_style($handle, $src, $deps, $ver, $media);
  8. wp_register_style('open-sans', 'http://fonts.googleapis.com/css?family=Bree+Serif:400,300,700', array(), false, 'all');
  9. wp_enqueue_style( 'open-sans');
  10. }
  11. add_action('wp_enqueue_scripts', 'add_fonts', 100);

Report this snippet  

You need to login to post a comment.