1. Discover problems
Recently, it was quite difficult to access google servers in China, but the speed was still relatively low.
The background was opened very quickly. It took 20 seconds to open it suddenly recently. Every page was like this, and it was almost collapsed.
The following error occurs when you press the console option to open the debugging mode of the browser:
That is, this error:
GET http://fonts.googleapis.com/css? Family = Open + Sans % 3A300italic % 2C400italic % 2C600italic % 2C300% 2C400% 2C600 & subset = latin % 2Clatin-ext & ver = 3.9.1 net: ERR_CONNECTION_TIMED_OUT
Note is loading google Fonts encountered trouble, loading the font code location is in (wordpress \ wp-Des \ script-loader.php 600th line ).
2. Solution: disable him and do not load him.
Add the following code to the topic functions. php file:
// Disable google font loading
Function remove_open_sans_from_wp (){
Wp_deregister_style ('Open-sans ');
Wp_register_style ('Open-sans ', false );
Wp_enqueue_style ('Open-sans ','');
}
Add_action ('init ', 'remove _ open_sans_from_wp ');
Page loading speed restored to normal
If the wordpress website reports an error after changing the style.css or function. Php file, it cannot be opened, or the image upload fails when the document is created. An error occurred while saving the wordpress file encoding. Open it in Notepad. When saving the file, replace the original file with the original encoding format of the website.