在WordPress主题里,如何去掉Google字体?

2025-10-25 08:29:23

1、最简单的一种禁用方法,就是安装插件Disable Google Fonts,然后进行禁用。进入WP后台,点击插件-安装插件-搜索Disable Google Fonts点击安装。

在WordPress主题里,如何去掉Google字体?

2、进入自己的虚拟主机管理面板,找到cpanel里面的文件管理器,里面就是wordpress的全部源码

在WordPress主题里,如何去掉Google字体?

在WordPress主题里,如何去掉Google字体?

3、第二种方法,是修改代码,以下代码添加到当前主题functions.php中。

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;

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢