我目前正在优化WordPress网站的速度,我成功地卸载了一些不必要的文件,但有一个文件我似乎无法删除,那就是:
https://domain.com/wp-includes/js/jquery/ui/effect.min.js?ver=1.11.4
有没有办法通过在其中添加php代码来防止加载此文件functions.php?任何帮助都将不胜感激。
非常感谢。
我目前正在优化WordPress网站的速度,我成功地卸载了一些不必要的文件,但有一个文件我似乎无法删除,那就是:
https://domain.com/wp-includes/js/jquery/ui/effect.min.js?ver=1.11.4
有没有办法通过在其中添加php代码来防止加载此文件functions.php?任何帮助都将不胜感激。
非常感谢。
如果要删除Effect Core,也必须删除依赖的脚本。按照以下步骤删除它们:
add_action( \'wp_enqueue_scripts\', \'remove_jquery_effects\', 100 );
function remove_jquery_effects()
{
wp_dequeue_script( \'jquery-effects-core\' );
wp_dequeue_script( \'jquery-effects-blind\' );
wp_dequeue_script( \'jquery-effects-bounce\' );
wp_dequeue_script( \'jquery-effects-clip\' );
wp_dequeue_script( \'jquery-effects-drop\' );
wp_dequeue_script( \'jquery-effects-explode\' );
wp_dequeue_script( \'jquery-effects-fade\' );
wp_dequeue_script( \'jquery-effects-fold\' );
wp_dequeue_script( \'jquery-effects-highlight\' );
wp_dequeue_script( \'jquery-effects-pulsate\' );
wp_dequeue_script( \'jquery-effects-scale\' );
wp_dequeue_script( \'jquery-effects-shake\' );
wp_dequeue_script( \'jquery-effects-slide\' );
wp_dequeue_script( \'jquery-effects-transfer\' );
}
将此添加到functions.php
文件这是从前端删除脚本。我正在尝试嵌入此代码:https://codepen.io/jme11/pen/zMVJVX我的Wordpress关于健身,但我不知道为什么它不能正常工作-我已经下载了代码的导出,它在独立的HTML(+js和css)文件中工作得很好(特别是完成的表单将显示在results div中)。然后,我将HTML嵌入到我的Wordpress模板页面中,它显示在前端,很好,我已经按照HTML中相同的顺序正确链接了css和js,并将它们检入(查看源代码显示它们已连接)填写表格并点击calculate确实可以做一些事情(