Last active
April 16, 2019 14:18
-
-
Save wpspeak/6068342 to your computer and use it in GitHub Desktop.
Use Google Custom Fonts in WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Use Google Custom Fonts in WordPress | |
function load_custom_fonts() { | |
wp_register_style('googleFonts', 'http://fonts.googleapis.com/css?family=Rock+Salt|Neucha'); | |
wp_enqueue_style( 'googleFonts'); | |
} | |
add_action('wp_print_styles', 'load_custom_fonts'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using 'Neucha' custom font | |
// Before | |
h1, | |
h2, | |
h3, | |
h4, | |
h5, | |
h6 { | |
font-family: Helvetica, Arial, sans-serif; | |
line-height: 1.25; | |
margin: 0 0 10px; | |
} | |
// After - 'Neucha' font added | |
h1, | |
h2, | |
h3, | |
h4, | |
h5, | |
h6 { | |
font-family: 'Neucha', Helvetica, Arial, sans-serif; | |
line-height: 1.25; | |
margin: 0 0 10px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment