實用的 WordPress ICP 備案許可管理器

如何去掉 Avada 5.7 Google fonts 字型及 googleajax.admincdn.com,加速後臺主題設定面板訪問?

如何去掉 Avada 5.7 Google fonts 字型及 googleajax.admincdn.com,加速後臺主題設定面板訪問?薇曉朵在 avada 中文版主題中已經進行了處理,使用更加方便,下面說下自己手動處理的辦法;

這是一個說大不大說小不小的問題,但還是有必要處理下,找到 avada 主題

/Avada/includes/lib/inc/redux/framework/FusionReduxCore/core/enqueue.php

開啟 enqueue.php 檔案定位到大約 291 行,如下:

wp_enqueue_script( 'webfontloader', 'https://googleajax.admincdn.com/ajax/libs/webfont/1.5.0/webfont.js', array( 'jquery' ), '1.5.0', true ); }

https://googleajax.admincdn.com/ajax/libs/webfont/1.5.0/webfont.js

替換為 `#` 修改後如下:

wp_enqueue_script( 'webfontloader', '#', array( 'jquery' ), '1.5.0', true ); }

https://googleajax.admincdn.com/ajax/libs/webfont/1.5.0/webfont.js

儲存即可。

這個是主題後臺的嵌入 js 所以暫時沒有好的方法可處理,後續的我們會想想其他方式。

另一個檔案在於:

找到

Avada/includes/lib/inc/redux/framework/FusionReduxCore/framework.php
var wf = document.createElement( 'script' ); 	wf.src = 'https://googleajax.admincdn.com/ajax/libs/webfont/1.5.3/webfont.js'; 	wf.type = 'text/javascript'; 	wf.async = 'true';

大約在 1677 行,修改方法同上

替換後為

var wf = document.createElement( 'script' ); 	wf.src = '#'; 	wf.type = 'text/javascript'; 	wf.async = 'true';

嫌上面的方法麻煩的話,可以購買薇曉朵 avada 中文版主題,只需要啟用中文子主題即可完成加速最佳化,更安全。

購買地址:

Avada | 企業 商店 響應式 多用途 WordPress 主題

已經在使用中文子主題,還想要更進一步最佳化?下面這篇文章是為您準備的。

https://avada.weixiaoduo.com/post/3543

文章沒看懂?程式碼不會用?需要幫助您可以

阿呆 的頭像