Home > Article > CMS Tutorial > How to change Chinese font in wordpress
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?
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;}
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’); }
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;}
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!