Thursday, March 23, 2023
  • Events
  • Interviews
  • Jobs
  • Opinion
  • Whitepapers
  • Podcasts
  • Web Hosting Directory
  • Login
  • Register
Cloud7 News
  • Cloud Computing
  • Web Hosting
  • Data Center
  • Linux
  • Cybersecurity
  • More
    • Software
    • Network/Internet
    • Hardware
    • Artificial Intelligence
    • Windows
    • Policy/Legislation
    • Blockchain
    • Troubleshooting
    • How-Tos
    • Articles
No Result
View All Result
Cloud7 News
  • Cloud Computing
  • Web Hosting
  • Data Center
  • Linux
  • Cybersecurity
  • More
    • Software
    • Network/Internet
    • Hardware
    • Artificial Intelligence
    • Windows
    • Policy/Legislation
    • Blockchain
    • Troubleshooting
    • How-Tos
    • Articles
No Result
View All Result
Cloud7 News
No Result
View All Result

Home > How-Tos > How to use Google Fonts in WordPress

How to use Google Fonts in WordPress

If you want to use Google Fonts on your website, you can check our step-by-step guide to set it up easily and correctly.


Rusen Gobel Rusen Gobel
October 15, 2022
4 min read
How to use Google Fonts on WordPress

If you have a WordPress website and you are not satisfied with the fonts you use, you can utilize Google Fonts to bring additional font families to your site. In this article, we will explain how you can easily integrate the font family you have chosen on Google Fonts into your site. You can easily achieve this with a small code block or a plugin. 

We want to remind you including additional font styles (bold, italic, and font weights) with the fonts might affect the performance of the website. Try to avoid importing unnecessary font styles.

Go to the Google Fonts website and choose the font family you want to use on your website. In this article, we will use the PT Sans font family.


Table of Contents

  • Adding Google Fonts via code
    • Step 1: Grab the link
    • Step 2: Edit the functions.php file
    • Step 3: Confirm the process
    • Step 4: Changing the fonts
    • Step 5: Check the changes
  • Adding Google Fonts via a plugin
    • Step 1: Find and install the plugin
    • Step 2: Activate the plugin
    • Step 3: Change fonts in Customize menu

Adding Google Fonts via code

Step 1: Grab the link

First, you need to go to the Google Fonts page of your selected font to get the unique link of it. Then scroll the page to go down the Styles section. Click the “+” button of your preferred font style. You can select multiple font styles as well. Then, in the “Use on the web” section, select the @import radio button. You’ll find the link as we highlighted in the screenshot below. Copy that link:


Step 2: Edit the functions.php file

Adding a font family is very easy with a small code block. Go to wp-content > themes > your-theme in the file system and open the functions.php file. Edit the code with the link you have copied and add it to the functions.php file; then save and exit:

<?php 
add_action( 'wp_enqueue_scripts', 'c7_add_google_fonts' );
function c7_add_google_fonts() {
wp_enqueue_style( 'c7-gfonts', 'https://fonts.googleapis.com/css2?family=PT+Sans:[email protected];700&display=swap', false );
}
?>

Step 3: Confirm the process

Refresh your website and search for PT+Sans in your page’s source file to confirm if fonts have been added. The image below shows that the PT Sans font has been successfully added.


Step 4: Changing the fonts

You can now use the font. Let’s change the font family of the p tag (default paragraphs) on our website. For this, enter the following code by editing it accordingly to your preferred font in the styles.css file in your theme’s folder.

p {
    font-family: 'PT Sans', Helvetica, sans-serif;
}

You can easily copy the code from the Google Fonts page, right under the “CSS rules to specifiy families” section which can be seen below:


Step 5: Check the changes

Congratulations! You have successfully changed your font for paragraphs with a font from Google Fonts.


Adding Google Fonts via a plugin

If you are not confident with your coding knowledge, you can easily perform this process with a plugin. It is a plugin called Easy Google Fonts developed by Titanium Themes.

Step 1: Find and install the plugin

Search, install and activate the plugin as in the image below:


Step 2: Activate the plugin

After installing the plugin, click Activate button to activate it.


Step 3: Change fonts in Customize menu

As you install and activate the plugin, you can now easily change your fonts with Google Fonts in Appearance > Customize in the WordPress interface. There, you will find be able to use Google Fonts for your paragraphs, headers, and more. After selecting a font, simply click Publish button at the top of the left-side menu to apply changes.

Congratulations! You have successfully changed your fonts with Google Fonts by using Easy Google Fonts plugin.

Tags: WordPress
Rusen Gobel

Rusen Gobel

Rusen Gobel is the managing editor of Cloud7. With more than 10 years of experience, Rusen worked as a hardware and software news editor for technology sites such as ShiftDelete, Teknokulis, Hardware Plus, BT Haber. In addition, Rusen publishes consumer product reviews on his YouTube channel. While consumer electronics has been his main focus for years, now Rusen is more interested in WordPress and software development. He had contributed different web application projects in his professional career. Rusen had graduated from Istanbul University, department of Computer Engineering. Rusen has a very high passion for learning and writing for every kind of technology. That's why he has been working as a tech editor for more than ten years on several different technology magazines and online news portals.

Leave a Reply Cancel reply

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

I agree to the Terms & Conditions and Privacy Policy.

Next Post
Top qualities to look for when hiring employees

Top qualities to look for when hiring employees

Related News

How to change system language on Windows 11

How to change system language on Windows 11

March 22, 2023 7:00 pm
How to create and manage menus in WordPress

How to create and manage menus in WordPress

March 22, 2023 6:30 pm
Learn how to install GE-Proton on Steam Play using the ProtonUp-Qt app

How to install GE-Proton on Steam Play using the ProtonUp-Qt app

March 14, 2023 3:15 pm
How to create a song with AIVA for free

How to create a song with AIVA for free?

March 13, 2023 5:50 pm
Get free daily newsletters from Cloud7 News Get the Cloud7 Newsletter
Select list(s):

Check your inbox or spam folder to confirm your subscription.

By subscribing, you agree to our
Copyright Policy and Privacy Policy

Get the free newsletter

Subscribe to receive the latest IT business updates straight to your inbox.

Select list(s):

Check your inbox or spam folder to confirm your subscription.

Recent News

  • How to change system language on Windows 11
  • How to create and manage menus in WordPress
  • Interview: Tim Mackey, head of supply chain risk strategy of Synopsys
  • 7 richest domains and the reasons why
  • CISA aims to identify vulnerabilities that attract ransomware

Cloud7 News
Cloud7 is a news source that publishes the latest news, reviews, comparisons, opinions, and exclusive interviews to help tech users of high-experience levels in the IT industry.

EXPLORE

  • Web Hosting
  • Cloud Computing
  • Data Center
  • Cybersecurity
  • Linux
  • Network/Internet
  • Software
  • Hardware
  • Artificial Intelligence
  • How-Tos
  • Troubleshooting

RESOURCES

  • Events
  • Interviews
  • Jobs
  • Opinion
  • Whitepapers
  • Podcasts
  • Web Hosting Directory

Get the Cloud7 Newsletter

Get FREE daily newsletters from Cloud7 delivering the latest news and reviews.

  • About Us
  • Privacy & Policy
  • Copyright Policy
  • Contact

© 2023, Cloud7 News. All rights reserved.

No Result
View All Result
  • Cloud Computing
  • Web Hosting
  • Data Center
  • Linux
  • Cybersecurity
  • More
    • Software
    • Network/Internet
    • Hardware
    • Artificial Intelligence
    • Windows
    • Policy/Legislation
    • Blockchain
    • Troubleshooting
    • How-Tos
    • Articles
  • Events
  • Interviews
  • Jobs
  • Opinion
  • Whitepapers
  • Podcasts
  • Web Hosting Directory

© 2023, Cloud7 News. All rights reserved.

Welcome Back!

Sign In with Facebook
Sign In with Google
Sign In with Linked In
OR

Login to your account below

Forgotten Password? Sign Up

Create New Account!

Sign Up with Facebook
Sign Up with Google
Sign Up with Linked In
OR

Fill the forms below to register

*By registering into our website, you agree to the Terms & Conditions and Privacy Policy.
All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In

Add New Playlist

This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.