[Abstract] The default background font of WordPress is sans serif. The Song typeface in Windows is not beautiful. You can customize the background font with only a piece of code.
At present, the flattening of website pages is popular, and the Windows system has the largest market share. Therefore, most of the default fonts for domestic WordPress themes are Microsoft Yahei. Personally, I prefer this refreshing feeling. However, the WordPress background dashboard does not use the default font of the theme, which is displayed directly in Song typeface, which is too ugly.
Looking at the source code, we found that the font style of WordPress background management interface is "sans serif". After 4.6.1, a lot of messy fonts have been added. In Chinese, it is directly Song typeface on Windows, and it is awkward to see more of Microsoft Yahei on the front. I thought that changing CSS would solve this awkward font problem. In fact, it's not that simple.
Because the WordPress background style is not a traditional css static file, but a CSS generated by combining PHP files, it needs to modify the program files, which is obviously not suitable for ordinary webmasters. In addition, WordPress needs to be modified after upgrading.
Finally, with the help of network materials, you can customize WordPress background fonts by adding a code in functions.php. The code is as follows.
//Modify background display font function admin_lettering(){ echo'<style type="text/css"> body{ font-family: Microsoft YaHei;} </style>'; } add_action('admin_head', 'admin_lettering');
The source of the above code is unknown, thank the original author.
Usage: At the end of the topic template function functions.php?> Just add code before. If you want to display other fonts in the background, please modify the "Microsoft YaHei" in the code.
After adding, open the background, and the familiar Microsoft Yahei is back.
This article was last updated on March 29, 2017, and has not been updated for more than one year. If the article content or picture resources are invalid, please leave a message for feedback, and we will deal with it in a timely manner. Thank you!