In WordPress, many themes, especially free ones, do not offer a wide range of font choices for Chinese fonts. However, you can enhance your WordPress website by adding Chinese fonts and setting them as the default font through a few methods. Below, we summarize 3 methods for modifying the default font in WordPress:
Method 1: Add Chinese Fonts through Custom CSS
You can manually add CSS to set the Chinese fonts in WordPress under the “Custom” -> “Additional CSS” option. Here’s how to do it:
Access your WordPress admin dashboard and click on “Appearance” -> “Customize”.
Find the “Additional CSS” section.
Insert the following code to set your preferred Chinese fonts as the default font, choosing from commonly used fonts like Noto Sans SC, Microsoft YaHei, or PingFang SC:
body {
font-family: 'Noto Sans SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
This method ensures that all text on your website will use the Chinese fonts you’ve set. If you wish to apply different fonts for headings (H1, H2, H3), you can specify them separately:
h1 {
font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}
h2 {
font-family: 'PingFang SC', sans-serif;
}
h3 {
font-family: 'SimSun', sans-serif;
}
Method 2: Use Plugins
Plugins can significantly expand your font options, including Chinese fonts. For example, you can use the Easy Google Fonts plugin to load Google fonts like Noto Sans SC. Here’s how:
Go to the plugins section and install Easy Google Fonts.
Use the font manager to select and apply your desired fonts.
Additionally, if you need a broader selection of Chinese fonts, you can utilize Adobe Fonts (formerly Typekit) or Font Squirrel to add custom fonts.
Method 3: Modify Theme Files
If you have technical skills, consider modifying your theme’s functions.php
file or CSS file to manually include Chinese fonts. You can use the @import
statement or include font links in the <head>
section of your HTML:
function custom_fonts() {
wp_enqueue_style('custom-google-fonts', 'https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;700&display=swap', false);
}
add_action('wp_enqueue_scripts', 'custom_fonts');
This method offers greater flexibility in adding Chinese fonts to your theme. If you wish for font options to also appear in theme selection boxes, modifications to PHP files may be necessary, requiring a deeper level of development knowledge.
Feel free to experiment with these methods and find out which works best for your needs. If you need further adjustments or specific details, don’t hesitate to ask!