我想删除默认jQuery,因为我正在添加新的或最新的jQuery。此外,我想在我的页脚包括一些js。我该怎么做?
我想在我的页脚中添加另一个不同的js,如滑块js或css。
我想删除默认jQuery,因为我正在添加新的或最新的jQuery。此外,我想在我的页脚包括一些js。我该怎么做?
我想在我的页脚中添加另一个不同的js,如滑块js或css。
这将在添加到函数文件时实现:
if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);
function my_jquery_enqueue() {
wp_deregister_script(\'jquery\');
wp_register_script(\'jquery\', "//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js", false, null);
wp_enqueue_script(\'jquery\');
}
我正在搜索我在这里得到一个博客,我得到两个不同的代码。一个用于
<?php
function myphpinformation_scripts() {
if( !is_admin() ) {
wp_deregister_script( \'jquery\' );
wp_register_script( \'jquery\', get_stylesheet_directory_uri() . \'/js/jquery.min.js\', false );
wp_enqueue_script( \'jquery\' );
}
}
add_action( \'wp_enqueue_scripts\', \'myphpinformation_scripts\' );
?>
在这里我可以找到
<?php
function myphpinformation_scripts() {
wp_enqueue_script( \'scroll\', get_stylesheet_directory_uri() . \'/js/script.js\',array(\'jquery\'),\'\',true);
}
add_action( \'wp_enqueue_scripts\', \'myphpinformation_scripts\' );
?>
Remove WordPress default jQuery from front end
我们可以从前端删除默认的wordpress jQuery,以避免与主题中的jQuery冲突。为了删除默认jQuery,请在函数中添加以下代码。主题文件夹中的php文件。add_action(\'wp_enqueue_scripts\', \'no_more_jquery\'); function no_more_jquery(){ wp_deregister_script(\'jquery\'); }
我使用以下指南在Raspberry Pi上安装了WP:https://www.raspberrypi.org/documentation/usage/wordpress/我还没有完成关于permalinks的最后一部分。问题是,当我使用我的本地网络导航到我的网站时,一切都很好,然后我从互联网上尝试,它需要很长时间,只显示文本,没有样式等。找到原因是在主文件的底部,靠近它的页脚:... <script type=\'text/javascript\' src=\'http://192.16