Thursday, November 28, 2019
How to Add Custom Fonts to Your WordPress Site (3 Methods)
Typography is more important than most people give it credit for. The fonts you use not only impact your websiteââ¬â¢s presentation, they can also make it stand out from other sites and render your content easier to read. Picking the same fonts as everyone else might be a safe bet, but it can be worth your while to add custom fonts to WordPress.Although WordPress includes a decent variety of font options out of the box, there are plenty of ways to improve on that selection. If you know how to include custom fonts on your website, youââ¬â¢ll be able to pick from thousands of exciting options. This will enable you to find a font that fits your niche and audience.In this article, weââ¬â¢re going to talk about what custom fonts are and where you can find some excellent choices. Then weââ¬â¢ll go over three methods you can use to upload custom fonts to WordPress. Letââ¬â¢s get to it! content management system (CMS) doesnââ¬â¢t include out of the box. There are thousands of custom font options that you can find online, and in general terms, nothing is stopping you from using any of them.Keep in mind, though ââ¬â the fonts you choose shouldnââ¬â¢t just be aesthetically pleasing. They should also meet some additional criteria:Each font you include should be easy to read.It needs to fit in with the general style of your website and the other fonts you use.Letters should look good at both large and small sizes, since you need to keep mobile responsiveness in mind.Aside from these technical considerations, fonts provide you with an additional way to express your siteââ¬â¢s style. They can become a part of your branding, and over time users might come to associate them with your site and business. So youll want to consider your choices very carefully.Where you can find custom fonts for your WordPress siteIf you do a quick search for ââ¬Ëfree fontsââ¬â¢ using any search engine right now, youââ¬â¢ll find hundreds of pages with broad selec tions to pick from:The problem, however, is that a lot of those free font websites donââ¬â¢t tend to have high standards when it comes to curating their selections. You may be able to find some jewels, but in many cases, theyââ¬â¢ll also be full of fonts you wouldnââ¬â¢t be caught dead using even if you were working on a 2005 MySpace profile.Fortunately, there are a lot of excellent font repositories that do go to great lengths to curate their collections. One of our favorites is Google Fonts, which offers over 900 font families in several languages, all of them free:Another excellent option is Adobe Fontsà (formerly Typekit), which provides over 1,700 font families to choose from. Keep in mind, though ââ¬â to access them youââ¬â¢ll need a Creative Cloud subscription (any tier will do). If youââ¬â¢re an Adobe user, that means you already have access to the entire font collection:These two sources alone will give you plenty of options to choose from. Keep in mind when making your selection that each font you choose should fit in with the rest of your siteââ¬â¢s style, and be easy to read. Once youve found a few fonts you like, all thats left is to add them to your website.How to add custom fonts to your WordPress site (three methods)When it comes to custom fonts, WordPress provides you with several ways that you can implement the options you want. Letââ¬â¢s go over what each involves, so you can select the method that works best for you.1. Edit your themes fileIf you donââ¬â¢t want to upload font files to your website manually, you can always ââ¬Ëimportââ¬â¢ them from third-party repositories. With Google Fonts, for example, you can open any font page you want and click on Select This Fontà at the top of the screen:Once you do that, a new menu will appear that includes two snippets of code. The first one should look like this:link href="https://fonts.googleapis.com/css?family=Robotodisplay=swap" rel="stylesheet"This code sh ould be placed within the head tags of your child themeââ¬â¢s header.php file. You can find this within your themeââ¬â¢s folder in the public_html/wp-content/themes directory.With that line, youââ¬â¢re telling WordPress to import the option you selected from Google Fonts. To use it, though, youââ¬â¢ll also need to open your child themeââ¬â¢s stylesheet and specify which elements should take advantage of your new font. Hereââ¬â¢s what that code should look like:font-family: 'Roboto', sans-serif;Remember, your child themeââ¬â¢s stylesheet should be within the same directory as its header.php file. That means you can take care of both tasks in the same place, and implement new fonts in just a few minutes.2. Upload your fonts file to your themes folderIf youââ¬â¢re all about performance optimization, uploading font files to your website directly can enable you to shave a few milliseconds off your loading times. The first thing youââ¬â¢ll need, of course, is th e font file you want to upload to your server:Since WordPress doesnââ¬â¢t include a dedicated fonts folder, youââ¬â¢ll want to create one using your trusty FTP client. You can add the folder wherever you want, but we recommend placing it within your themes directory so you can keep track of it. Set it up now, and upload your font file to the new folder:Once the file is in place, open up your child themeââ¬â¢s stylesheet. Now youââ¬â¢ll need to call on that font so you can use it, via a snippet that should look like this:@font-face { font-family: New Font; src: url(http://www.yourwebsite.com/wp-content/themes//fonts/your-new-font.ttf); font-weight: normal; }Please note the font family name and URL above are placeholders, which youââ¬â¢ll need to replace with the right information.Once youve entered this code, donââ¬â¢t close your themeââ¬â¢s stylesheet just yet. You still need to configure which elements will use the new font, with some code thats very similar to what we looked at in the last section:.h1 site-title { font-family: "New Font", Arial, sans-serif; }In this example, weââ¬â¢re configuring our H1 subheadings to use the new font. However you can replace that with any other element you want, or multiple elements if youd like to use the font in more than one place.3. Use a pluginAs is often the case, the easiest way to implement new functionality in WordPress is to install a plugin. When it comes to using custom fonts, there are a lot of options to pick from.For example, if you want to use Google Fonts, we recommend the aptly-named Google Fonts for WordPress plugin. After activating this tool, youââ¬â¢ll be able to pick from the entire Google Fonts catalog for your pages and posts, without the need to add any code to your website: Google Fonts Typography Author(s): Custom Fonts Author(s): Brainstorm ForceCurrent Version: 1.2.0Last Updated: October 3, 2019custom-fonts.1.2.0.zip 94%Ratings 232,599Downloads WP 4.4+Requires With this plugin, you get to upload fonts to your website right from the dashboard, and use the Customizer to pick where and when to use them. Either of these plugins makes it a breeze to add new custom fonts to your site.ConclusionIf you pay attention to the fonts that websites use, youââ¬â¢ll notice that many of them stick to the same few tried-and-true choices. Some fonts are pretty safe bet when it comes to readability and user accessibility. However, with thousands of options to choose from ââ¬â both free and paid ââ¬â its worth looking for one that also fits your websiteââ¬â¢s style and audience perfectly.As for how to upload custom fonts to WordPress, you can go about it using three different approaches:Edit your themeââ¬â¢s file.Upload the fontââ¬â¢s file to your themes folder.Use a WordPress custom fonts plugin. Want to add custom fonts to #WordPress? Here are 3 easy ways to do it ðŸ⦠°Ã¯ ¸ #tutorial Click To Tweet Do you have any questions about what types of fonts you should use on your website? Letââ¬â¢s talk about them in the comments section below!Free guide5 Essential Tips to Speed Up Your WordPress SiteReduce your loading time by even 50-80% just by following simple tips.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.