wordpress常用主题、插件优化
fydy opened this issue · 0 comments
fydy commented
- DIVI字体修改
主题自加载google的开源字体,支持中文。google官方https://fonts.google.com/earlyaccess选择自己需要的字体,然后替换\wp-content\themes\Divi\functions.php约640~666行
'ms_MY' => array(
'language_name' => 'Malay',
'google_font_url' => '//fonts.googleapis.com/earlyaccess/notosansmalayalam.css',
'font_family' => "'Noto Sans Malayalam', serif",
),
'zh_CN' => array(
'language_name' => 'Chinese', //这是中文
'google_font_url' => '//fonts.googleapis.com/earlyaccess/cwtexfangsong.css', //替换css地址
'font_family' => "'cwTeXFangSong', serif",
),
- WPBakery Page Builder去除版权提示
在源代码中,头部文件会出现WPBakery Page Builder版权的信息,打开\js_composer\include\classes\core\class-vc-base.php,约672行去除版权信息
public function addMetaData() {
echo 'meta name="generator" content="Powered by WPBakery Page Builder - drag and drop page builder for WordPress."' . "\n";
}
建议把 echo 后面替换为百度的声明:meta name="applicable-device" content="pc,mobile"
- Enfold汉化中文版
去除google maps,后台加载更快。打开主体目录下,找到\enfold\framework\php\inc-autoconfig.php 约192行
//require( AVIA_PHP.'class-gmaps.php' ); //注解掉
- WP Rocket授权修改
使用中,提示的授权与否对使用并没太大影响,如果要修改请打开wp-rocket\inc\classes\admin\settings\class-page.php,约200行找到
private function get_customer_data() {
$customer_key = defined( 'WP_ROCKET_KEY' ) ? WP_ROCKET_KEY : get_rocket_option( 'consumer_key', '' );
$customer_email = defined( 'WP_ROCKET_EMAIL' ) ? WP_ROCKET_EMAIL : get_rocket_option( 'consumer_email', '' );
//......省略一堆.....//
return $customer_data;
}
删除这段,替换为下面,原理就是固定为Plus版,时间是今天加上一年,你自嗨写100年也可以。(仅对v3.2.6参考)
private function get_customer_data() {
$customer_data->licence_account = 'Plus';
$customer_data->licence_expiration =date('Y-M-d', strtotime('+1 years'));
return $customer_data;
}