Right Way to use Google Web Fonts on your WordPress

Avatar

Already we had known that Google Web Fonts will vastly improve, especially interface websites. Well, Google Web Fonts is also offers really easy to use non-standard fonts on your websites. They have over 180 fonts and counting. We can directly check out at http://www.google.com/fonts/

Google is also providing clear instructions on how to embed their fonts, so you don’t difficult need knowledge or instruction to explore it. For WordPress platform, there’s a much better how to use Google Web Fonts. You can using the wp_enqueue_style function and just put a few line codes to making it working.

The code that Google gave us will look like below:

google-font

But we can create a function to registers the stylesheet for using ‘googleFonts’ with the URL provided by Google. Just open functions.php file on existing theme folder and copy these codes.

 

This way is much better practice when you’re using WordPress with child themes. So you don’t worry to update the parent’s header.php and your child theme because these methods will keep your themes portable and plugin-friendly.

Leave a Reply

Your email address will not be published. Required fields are marked *