SLOW
Since WP recently updated several new versions since,Open WP from national speed is getting slower and slower,Seconds on a stretch from the original into a child can not open,This route had once made their own blog hosts, where the wall is out =。=
later,WP Super Cache get the route to achieve a full stop pre-caching,Then also optimized the code highlighting pluginWP syntaxhighlighter,Can still access speed is not very satisfactory,Until today, all of a suddenHost sideSaid a WP blog slow access solutions。
Google's Open Sans font
Because Google does not fit me towards a policy,It turned out like this now,So Google service moving within the basic disability,Then, if you view the page source in the latest version of WordPress Home files,You will see the following line:
1 |
<link rel='stylesheet'id='open-sans-css' href='//fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext&ver=3.8'type='text/css'media='all' /> |
Of course,If you use any browser to see the pattern of development timeline,We will see this thing is the longest load time,Sometimes even give you a minute to brush。and,It is not finished loading,The page is not out =。=
so,We should adapt to conditions,Remove this line maddening code,WP completely eradicated from the Open Sans
Eradication of several steps Open Sans
Font said that the influence of the background,Actually,It also affects the foreground,All right.,We begin with a theme from the use of。
Remove topic Open Sans
First you need to check under your theme directoryfunctions.php file,In it add the code below to save:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
//禁用Open Sans class Disable_Google_Fonts { public function __construct() { add_filter( ‘gettext_with_context’, array( $this, ‘disable_open_sans’ ), 888, 4 ); } public function disable_open_sans( $translations, $text, $context, $domain ) { if ( ‘Open Sans font: on or off’ == $context && ‘on’ == $text ) { $translations = ‘off’; } return $translations; } } $disable_google_fonts = new Disable_Google_Fonts; |
Then try to refresh your site,If you're like meBlog throughout a whiteGot it,Then please remove this sentence (I hope you are not directly edit this file in the background or you can ............Skip this step)
Similarly sytl.css then find the file in your theme directory to edit the corresponding,Search Keyword font-family,See behind the font reference is not included in "Open Sans",For example, routing using this theme contains this font,So we put them into other mass fonts,For example, the route changed so:
1 |
body {font-family:"Microsoft YaHei", Helvetica, Arial, sans-serif; font-size:14px;line-height:150%;background:#F9FFF9;color: #444;} |
Remove the background of Open Sans
Script-loader.php find this file in the wp-includes directory,Then find this section,In about 570 lines,Modifications:
1 2 3 4 5 |
/* translators: If there are characters in your language that are not supported * by Open Sans, translate this to ‘off’. Do not translate into your own language. */ if ( ‘off’ !== _x( ‘on‘, ‘Open Sans font: on or off’ ) ) { // (改成 off 来关闭 open-sans 字体) $subsets = ‘latin,latin-ext’; |
Such,In fact, both front and back to get rid of the drag speed Open sans font。
Written in the last words
In fact, tell the truth each with a different theme inside its code style,The modified manner will vary,Especially if you are using some less formal third party and custom themes,That you may be more headache,so,I think you'll like the next word -
installation"Disable Google Fonts"This plug-in,Directly in one step =。-
Other than that,You can also refer toHereandHereTo see their point of view。
Original article written by LogStudio:R0uter's Blog » WordPress complete eradication of Open Sans font
Reproduced Please keep the source and description link:https://www.logcg.com/archives/553.html