How to add Google fonts to WordPress sites

The look and feel of a website is very important to attract and maintain the interest of visitors. The content of a website can be controlled by text, images, or media. No matter where it is used, the text must be carefully selected, whether it is rich or not. Typography plays an important role in the overall appearance and feel of a website. The built-in font can be used in the browser, style. CSS files typically access these fonts for display. This means that there is no deformation, so the site is bland. But you don’t have to. You can choose the fonts that make your site unique. Sometimes fonts become a feature of websites. The
It may be useful to know that all fonts belong to one of two types. In other words, sans serif (sans serif) means that the font has an added line or drying at the end of the main stroke, or there is no such line or drying. There are many places to access beautiful fonts, such as choosing the font fontsquirrel. Ensure that the licenses attached to these resources are available for use. In general, the themes used by websites are provided with font selection, and they need to be used well. Advanced fonts can also be purchased from the typekit. The
When selecting fonts, please select a style that matches the website atmosphere or target customers. For example, the play school website can use fonts that look like children’s handwriting. If you want to combine the two styles, select the opposite of thick and thin. Most importantly, the font must be readable. Adding Google fonts to existing themes may not be a good idea. Because to add Google fonts, you must use the filters and hooks provided by the theme. Nevertheless, Google has a large font library that is regularly updated. This tutorial will learn how to integrate with a web site. The
When a font is selected, it is added differently. One way is to font files, which may take up server space. In addition, not all font files are compatible with all browsers. To use other methods, you must use queue attached scripts to connect external scripts to the site. You can add Google fonts using the plug-in. Method 1: use code to add Google fonts. The method of merging Google fonts includes partial editing of existing themes. Therefore, it is recommended that you work within sub themes to avoid losing changes during updates. The
Open the Google fonts page in your browser to view the available font options. When you find what you want, click the add to collection button for that font style. In this tutorial, you select dancing script styles with weights of 700 and 400. You can select one or more font styles. In this case, multiple font styles are symbols of \
Male then click the use button on the right. Another page opens where you can select the thickness of the font. The dial on the right indicates how quickly the web site loads each font style and thickness. When one or more font styles are added, the total speed of all font styles is displayed on the dial. You can also add specific special characters to the selected language on this screen. The page is downward. In step 3, three tabs of standard, import and JavaScript will be displayed. You can select any of these tabs to insert code into the web site. The
The code containing the name of the selected font (highlighted) under the import tab
Display@ Import URL( http:\/\/fonts.googleapis.com\/css?family=Dancing +Script:400700); Now take this code as the style of the subject. Just paste it into the CSS file. This method is easy to imitate, but the disadvantage is that the site speed is slow. Because you must the imported file before ing the rest. A better way to add Google Fonts is to click the standard tab and use the generated code. The
Male code fragment header. Pasting directly into PHP may not actually perform the trick. Changing files in the parent theme is not recommended because all changes may be lost in the next update. A more concise way to do this is with the functions of the subtopics. Change PHP. That is, these changes will be played back after the parent theme function runs (without redefining the parent function). The generated link is a stylesheet declaration. You can register this code in \
Function load_fonts(){
Wp\u register\u style (‘googlefonts’,
‘ http:\/\/fonts.googleapis.com\/css?family=Dancing +Script:400700’);
Wpuenqueue_style (‘googlefonts’);
}The
Add\u action (‘wp\u enqueue\u scripts’,’load\u fonts’); When finished, save the file. With this operation, the code is included in the header, and the sub topic is the parent title. Continue to inherit PHP. This method improves topic portability while maintaining compatibility with plug-ins. The
There is only one step left to integrate Google fonts into CSS. Therefore, navigate to the default CSS style sheet and add the following font family declaration: Body{
Font family:’dancing+script’, sans serif;
Font size: 14px;
Color: \191919;
}Similarly, you can apply the same style formatting to other elements and save the CSS file. Now you can see that the site has been updated with the selected font. If you choose to use the code generated by clicking the JavaScript tab, the header is used immediately after the head tag is opened. Paste the code into PHP. The
Method 2: you can also use the plug-in to add Google fonts, as you mentioned when you first used the plug-in to add Google fonts. It is easy to install and activate these plug-ins. However, choosing the right font with some plug-ins may be a bit sticky, because CSS may require some customization. There are many plug-ins that can help you add fonts to your site, including Google fonts. For example, fontmeister, supreme Google Web fonts, typecase web fonts, Google Web fonts manager. Let’s take a closer look at two popular plug-ins that will help you add Google fonts. WP Google font androg WP Google font adds the required code to the website. There are two ways to help you add fonts to the Google fonts directory. In the administrator panel, you can assign Google fonts to specific CSS elements on your web site. Alternatively, you can work in a style sheet with a unique theme. On the settings page, you can check the options to customize the font. However, there is no option to preview the font before pressing the Save button. You can save up to 6 settings and assign them to 6 different tags. Plug in
When a font is added to the Google font library, it is updated. Although there are more than 100000 active installations, the plug-ins and advertisements of other services are bundled together, which is annoying. Score 3.9 points. The simple Google fonts plug-in easy Google Fonts is integrated with the WordPress customization tool. Before setting the required font to 0 and saving it, you can create and preview custom fonts for the website. Fonts and font variants can be inserted without encoding. You can customize all aspects of the font (weight, size, height, color, spacing). When you select a Google font, all style sheets for that font are automatically added to the queue. The main advantage of this plug-in is that there is no need to modify the theme style sheet. That is, you can update the theme without losing Google fonts. The plug-in is. Mo and. A translation containing the Po file is also prepared. The plug-in is ideal for web site owners who want to change typography without encoding. Or, this is for those who have basic coding knowledge and want to add custom font rules. The plug-in has been installed more than 200000 times, with a score of 4.9 times. Conclusion now that you know how to add Google fonts to your site, you can try to convert them on your site. Adding too many font styles may slow down your web site, so keep them to a minimum.

Author:

Leave a Reply

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