Work Amazingly
  • Apps
  • Finance
  • Govt. Jobs
  • Jobs
  • News
  • Shop
  • SEO
  • Tools
    • Free Domain Checker Online
    • Free Youtube To mp3 Converter
  • What’s New
  • WordPress
Work Amazingly
  • Apps
  • Finance
  • Govt. Jobs
  • Jobs
  • News
  • Shop
  • SEO
  • Tools
    • Free Domain Checker Online
    • Free Youtube To mp3 Converter
  • What’s New
  • WordPress
Advertise With Us
  • Apps
  • Finance
  • Govt. Jobs
  • Jobs
  • News
  • Shop
  • SEO
  • Tools
    • Free Domain Checker Online
    • Free Youtube To mp3 Converter
  • What’s New
  • WordPress
Work Amazingly
  • Apps
  • Finance
  • Govt. Jobs
  • Jobs
  • News
  • Shop
  • SEO
  • Tools
    • Free Domain Checker Online
    • Free Youtube To mp3 Converter
  • What’s New
  • WordPress
How To Install Google Fonts In WordPress?

Google Fonts offer a wide range of fonts that can add to the design and aesthetics of a WordPress website. In this tutorial, we will go through the steps to install Google Fonts in WordPress.

Step 1:

Table of Contents

  • Step 1:
  • Step 2:
  • Step 3:
  • Step 4:

Choose your Google Fonts The first step is to choose the Google Fonts that you want to use on your website. You can browse through the fonts on the Google Fonts website and select the ones that you like. Once you have selected your fonts, add them to your collection by clicking the “+ Select this style” button next to each font.

Step 2:

Create a Custom Font Control File WordPress provides a way to add custom fonts to a theme using a custom font control file. To create this file, follow the steps below:

  1. Create a new file in a text editor such as Notepad.
  2. Copy the following code into the file:
<?php
function custom_fonts() {
    wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Roboto:400,700', array(), CHILD_THEME_VERSION );
}
add_action( 'wp_enqueue_scripts', 'custom_fonts' );
?>
  1. Replace the URL //fonts.googleapis.com/css?family=Roboto:400,700 with the URL of the Google Fonts that you want to use. You can add multiple fonts by separating them with a | character. For example, if you want to use the Roboto and Open Sans fonts, you can use the following URL: //fonts.googleapis.com/css?family=Roboto:400,700|Open+Sans:400,700
  2. Save the file with a .php extension. For example, you can save the file as custom-fonts.php.

Step 3:

Upload the Custom Font Control File to WordPress Now that you have created the custom font control file, you need to upload it to your WordPress website. Follow the steps below:

  1. Log in to your WordPress website and navigate to the wp-content/themes/your-theme-name directory.
  2. Upload the custom font control file that you created in Step 2 to this directory.
  3. Go to the Appearance > Editor section in your WordPress dashboard.
  4. Select your theme’s functions.php file from the list of files on the right-hand side.
  5. Add the following code to the end of the file:
require_once( get_stylesheet_directory() . '/custom-fonts.php' );
  1. Save the changes.

Step 4:

Check the Custom Fonts on your WordPress Site Now that you have added the custom fonts to your WordPress site, you can check to see if they are working correctly. Follow the steps below:

  1. Go to the frontend of your WordPress site.
  2. Refresh the page.
  3. Inspect the page using your web browser’s developer tools.
  4. Look for the font-family property in the CSS for the text that you want to check.
  5. Verify that the font-family property matches the font that you selected.

In conclusion, adding Google Fonts to a WordPress website is a straightforward process. By following the steps above, you can enhance the design of your website and make it more visually appealing.

Tags:
Google FontsWORDPRESS
Share:

Work Amazingly

A passionate web designer & developer. I love to write about new technology and web design related articles.

How To Install Codeigniter 4 In cPanel? April 5, 2023
How To Create A Simple Blog Website In... April 5, 2023

Leave a Comment Cancel reply

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

Search



Latest News

  • 5 free WordPress themes for blogging in 2023 which are fast and SEO friendly
    5 free WordPress themes for blogging…
    September 23, 2023
  • Internet’s ‘Kulhad Pizza’ pair makes an appeal for support in the face of a contentious video
    Internet’s ‘Kulhad Pizza’ pair makes an…
    September 23, 2023
  • Launch of the Realme GT 5: 240W quick charging provides two hours of talk time in just 30 seconds!
    Launch of the Realme GT 5:…
    August 23, 2023
  • Big discounts on the iPhone 14 Plus, iPhone 14, iPhone 13, iPhone 12, and more are available during Apple’s mega Flipkart sale.
    Big discounts on the iPhone 14…
    August 23, 2023
img4



Categories

  • Affiliate Marketing (1)
  • Android (2)
  • Apple (1)
  • Apps (3)
  • Artificial Intelligence (2)
  • Career (2)
  • CodeIgniter (1)
  • CSS (2)
  • Design (9)
  • Finance (17)
  • Freelance (3)
  • Govt. Jobs (5)
  • Hosting (1)
  • HTML (4)
  • Instagram (1)
  • ipl (3)
  • Jobs (3)
  • jQuery (1)
  • Maharashtra (1)
  • Marketing (6)
  • Mobiles (1)
  • News (5)
  • Online Learning (5)
  • PHP (1)
  • Sass Landing (5)
  • SEO (3)
  • Shop (3)
  • Story (1)
  • Tools (2)
  • Top 5 (3)
  • UI/UX (4)
  • What's New (1)
  • Wordpress (16)

Popular Tags

.mp3 2023 AI Android Apple Apps Budgeting Design Designing Facebook FD Fixed Deposite Freelancer Freelancing Govt. Jobs HTML Instagram Investing iPhone 13 ipl Javascript Jobs Maharashtra Marketing Meta Mobile Money new rule of ration NFDC Online Online Earning Online Learning Passive Income Punjab ration card holders Salary SEO Story Themes UIDAI Free Service Update your Aadhaar card Wages Websites WORDPRESS Work From Home



Want to write an article?

Send us a message and we’ll get in touch with you as soon as possible.

Let’s Get Started
logo

Web Design | Development | Technology | Affiliate Marketing | Digital Marketing | Online Learning | Online Earning Blog | Artificial Intelligence | Programming | Latest Jobs | Govt. Jobs | Wordpress

Quick Links

  • Affiliate Marketing
  • Artificial Intelligence
  • Design
  • Govt. Jobs
  • Finance
  • Wordpress
  • About
  • Cookies Policy
  • Privacy Policy
  • Terms & Conditions
  • Contact

Contact

workamazingly@gmail.com

help@workamazingly.com

Facebook-f Linkedin-in

© Work Amazingly. All Rights Reserved.