Learning and Sharing
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
No Result
View All Result

How to Add a Custom Font into Your WordPress Website

November 7, 2022
in Blog
2
ADVERTISEMENT

Table of Contents

Using custom fonts will help you expand the list of available fonts and use the ones that match your needs and brand. This functionality can be achieved easily in WordPress with or without a plugin.

Add a custom font into your WordPress site using plugin

Installing plugins to add custom fonts to WordPress is probably the simplest way to accomplish the task. Here are a few of the most popular options: WP Google Fonts, Easy Google Fonts, Use Any Font  . You can install then activate a plugin to add a custom font into your site.

An example when using WP Google Fonts plugin to add a font to your site.

Bg2490

But, in this post, I’ll focus on the second method to add a font into your WordPress site without installing any plugins.

Add a custom font into WordPress without plugins

Find the right custom fonts

You can find a great selection of free fonts on Use & Modify or in the The Definitive Guide to Free Fonts from Typewolf. Otherwise, you can take a step further and choose paid alternatives from fonts.com, Adobe Fonts, or Typography.com.

It is worth mentioning that not all web browsers support every custom font. Nevertheless, even if your chosen font is unsupported, you can still convert it to a compatible format.

Before converting fonts from one format to another, let’s have a quick look at different font formats:

  • Open Type Fonts (OTF) – the most commonly used web fonts and are a registered trademark of Microsoft. This format works well with almost all major browsers.
  • True Type Fonts (TTF) – developed by Microsoft and Apple in 1980. Widely used for both Windows and macOS.
  • Web Open Font Format (WOFF) – broadly used format for web pages and recommended by the World Wide Web Consortium (W3C).
  • WOFF 2.0 – considered a better option than WOFF 1.0 due to better compression abilities. This format is not supported by Safari and Internet Explorer but works well with Google Chrome, Firefox, or Opera.
  • Embedded OpenType Fonts (EOF) – more compact OTF fonts, used as embedded fonts on web pages. All major browsers support EOF.

Make sure that you have all the necessary font formats to display the Web fonts in all major browsers. There should be some Web Open Font Format (.woff or .woff2) files included.

Regardless of the source, each font will come with different font variations (weight and style). Sometimes, you need to convert fonts using Cloudconvert.

For example, I’ve downloaded an .ttf font, so I need convert it to .woff format.

Bg2498
Bg2499

Install the custom fonts into WordPress

If you don’t want to overburden your WordPress with plugins, you can manually add fonts to your website. You must upload your font to your hosting account and edit your theme’s CSS file.

1. Download the font you want to use to your computer then convert it to woff format.

2. Upload your font file to wp-content/fonts directory. Create a separate fonts folder if you don’t have one yet. You can use an FTP client like FileZilla or WinSCP.

Bg2500

3. Head to the WordPress admin area. Then, go to Appearance | Customize.

Note Note: The current WordPress versions provide a theme Customize option where you can add CSS changes that are not erased by theme updates
Bg2495

4. In the customization page, select Addition CSS option.

Bg2496

5. Insert the below code to set the font-face.

Note Note: Don’t forget to change font-family and URL values to match your font.
@font-face { 
    font-family: magica;
    src: url(http://bonguides.me/wp-content/fonts/magica.woff); 
    font-weight: normal; 
}
Bg2502
4. Press the button to save your changes. The font-face code loads the font every time a visitor visits your website. However, the font is still not applied to any element yet.

5. To assign the font for a specific element, you need to add more custom CSS codes. For example, the following code would apply the custom font to website’s title.

h3 { 
    font-family: magica;
}

In this example, we’re configuring the H3 to use the new font. However, you can replace that with any other element you want, or multiple elements if you’d like to change the font in more than one place.

Bg2503

The final result, the font was changed for H2.

Bg2504

Change The Font Globally

Stick this line of code on the top of your Stylesheet to use the new font in all areas.

* {font-family:'magica'}

Change The Font for Specific Theme Areas

More often than not, you’re going to want to have different fonts for different types of font for different areas on your site. However, identifying font areas can be a pain because WordPress themes use font in a variety of different ways. In reality, fonts can be used anywhere.

For the most part, a certain custom font is found in the body of the WordPress website. This is an overarching web font and will be used to determine the base font for fonts within the site that aren’t defined by a specific tag, class, or div.

Fonts within the post content are generally located in the following CSS classes: content. post, entry, and post-entry.

body {font-family: 'magica', Arial, Helvetica, Futura, sans-serif;}
ADVERTISEMENT
5/5 - (2 votes)
Previous Post

How to Check the Font Family & Font Size on a Website

Next Post

How to Globally Change the Font in a WordPress Site

Related Posts

Running Hyper-V and VMware Workstation on The Same Machine

August 15, 2024

How to Uninstall All Autodesk Products At Once Silently

July 29, 2024
Ftr5

How to Uninstall the Autodesk Genuine Service on Windows

July 29, 2024
Ftr19

How to Fix Windows Cannot Read the ProductKey From the Unattend Answer File in VirtualBox

July 26, 2024
Ftr25

How to Update Windows Terminal in Windows 10/11

July 26, 2024

How to Disable The Beep Sound in WSL Terminal on Windows

July 26, 2024

Comments 2

  1. madrid|Maillot real madrid pas cher|Maillot real madrid|Maillot real madrid 2022-2023|tenue de sport|Maillot real madrid 2022|Maillot real madrid 2023} says:
    2 years ago

    Your style is so unique compared to other folks I have read stuff from. Barbette Quent Dillon

    Reply
    • bon says:
      2 years ago

      Glad to hear.

      Reply

Leave a Reply Cancel reply

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

Recent Posts

  • How To Turn On uBlock Origin Extension in Chrome (2025)
  • Images Hidden Due To Mature Content Settings In CivitAI
  • Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

Categories

Stay in Touch

Discord Server

Join the Discord server with the site members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions and discuss everything with the site members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤. Sharing to be better.

Newsletter

Join the movement and receive our weekly Tech related newsletter. It’s Free.

General

Microsoft Windows

Microsoft Office

VMware

VirtualBox

Technology

PowerShell

Microsoft 365

Microsoft Teams

Email Servers

Copyright 2025 © All rights Reserved. Design by Leo with ❤

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory