Modify WordPress background display font

2016-12-14 17:08 Originated from this website 44,570 ten two
[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.

修改WordPress后台显示字体

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.

修改WordPress后台显示字体

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.

修改WordPress后台显示字体

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!

If you think this article is helpful, please sponsor this website

 Alipay scanning sponsorship WeChat scanning sponsorship

  • Alipay scanning sponsorship
  • WeChat scanning sponsorship
  • Statement: All text, pictures and other materials marked "Original on this site" are copyrighted Yaxi All, welcome to reprint, but please indicate the source;
    Current comments: 10 of which: visitors 0 bloggers 0
    Loading
    1. Not bad, come here and give me a thumbs up!
      The blogger urged more!

    2. Seven years ago (2016-12-17) 0F

       [White eyes] Because I just look at it myself, I'm too lazy to bother

    3. I'm here to hurry up, hehe! [Picking the nose]

    4. Good, I can try it! Thanks for sharing!

    5. Seven years ago (2016-12-15) 0F

      I have been unaccustomed to the background of wp. I feel unaccustomed

    6. Seven years ago (2016-12-15) 0F

      Not bad, but I'm generally too lazy to bother with these things. [Sneaking]

    7. Seven years ago (2016-12-15) 0F

      When can I get some benefits? Mine belongs to zblog

    8. Seven years ago (2016-12-15) 0F

      This method is powerful. It is simple but practical and practical. The blogger's technology is getting better and better. Recently, there are many dry goods [Strong]

    Comment

     doubt  naughty  Sad  Pick one's nose  scare  smile  lovely  A bad laugh  surprised  Daze  doubt  Soldiers  Snicker  Curse  Anger  roll one's eyes  applause  proud  Wipe away sweat  kiss  Cry  open the mouth and show the teeth  halo  strong

    share ten two 44,570
    Top