Home > CMS Tutorial > WordPress > body text

How to change Chinese font in wordpress

爱喝马黛茶的安东尼
Release: 2019-07-18 10:59:13
Original
7244 people have browsed it

When using foreign wordpress themes, Google fonts are usually used. However, after you use it on a Chinese website, the Chinese characters are all in Song font, which is very inconsistent with the theme of the website. How to modify it?

How to change Chinese font in wordpress

To change the WordPress foreign theme font to Microsoft Yahei, you only need to add a custom CSS. If there is a custom CSS input in your theme options place, just copy this code into it:

* {font-family: "Microsoft YaHei" !important;}
Copy after login

If your theme does not support custom CSS input, then add the above sentence to the first line of your style.css.

However, many foreign themes currently use icon fonts. After adding Yahei code, many font icons are not displayed, which affects the appearance and user experience.

Related recommendations: "Wordpress Tutorial"

Recently I also found a solution, which is to add this code to the custom CSS:

@font-face {
font-family:’Open Sans’;unicode-range:U+2E80-FFFF;src: local(‘Microsoft YaHei’);
}
Copy after login

It solves this problem very effectively. If you also encounter this problem, you can try this method to solve it.

Additionally, if the above code is useless, you can try the following code:

*:not([class*="icon"]):not(i){font-family: “Microsoft YaHei” !important;}
Copy after login

Each topic is different, and the solution may be different.

The above is the detailed content of How to change Chinese font in wordpress. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template