WordPress优化加速技巧:禁用 WordPress 的 Emoji 功能

前端之家收集整理的这篇文章主要介绍了WordPress优化加速技巧:禁用 WordPress 的 Emoji 功能前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

使用完成以后,浏览网站时速度很慢,查看源代码发现有一大段莫名的代码,如下图:

emoji

这是wordpress自带的Emoji功能,它的的实现方式是调用 http://s.w.org/images/core/emoji/72×72/ 下的图片来渲染Emoji,而http://s.w.org/images/core/emoji/72×72/这个地址在国内是访问不了的,所以我们需要禁用 wordpress Emoji 功能。这篇wordpress教程里我们就向大家介绍一下具体的方法

切换到主题目录,打开functions.PHP文件添加以下代码

Crayon-5c891d16e6e5c936366019" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">functions.PHP
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-mixed-highlight" title="Contains Mixed Languages">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-language">PHP
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">