WordPress themes often come with default fonts, but you may want to customize your site’s typography to match your brand. On ruachost.com, you can import Google Fonts into WordPress using a simple code snippet or plugins.
Why Use Google Fonts?
-
Free and easy to integrate.
-
Wide selection of professional fonts.
-
Improves site design and readability.
-
Loads quickly from Google’s CDN.
Method 1: Add Google Fonts via functions.php
-
Log in to WordPress with an administrator account.
-
In the dashboard, go to Appearance → Theme Editor.
-
Select your active theme and open the functions.php file.
-
Add the following code snippet:
// Import Google Fonts into WordPress function add_google_fonts() { wp_register_style('OpenSans', '//fonts.googleapis.com/css?family=Open+Sans:400,600,700,800'); wp_enqueue_style('OpenSans'); } add_action('wp_print_styles', 'add_google_fonts'); -
Click Update File to save changes.
-
Open your theme’s CSS file and apply the font:
body { font-family: 'Open Sans', sans-serif; font-size: 20px; color: #000000; }
✅ Your site will now load and use the Open Sans font.
Method 2: Use a Plugin (No Coding)
-
Install a plugin such as Easy Google Fonts.
-
Activate it and go to Appearance → Customize → Typography.
-
Select and apply Google Fonts to headings, body text, or specific elements.
Important Notes
-
Always back up your theme files before editing.
-
Use a child theme to preserve changes during updates.
-
Loading too many fonts can slow down your site, choose only what you need.
-
Ensure proper fallback fonts (e.g.,
sans-serif) for browsers that don’t support Google Fonts.