在模板head。php文件引入cdn
wordpress\wp-content\themes\主题名称\header.php
<script src="//cdn.bootcss.com/jquery-parallax/1.1.3/jquery-parallax-min.js"></script>
//--------------以下为过时答案
点这里看原文
请看Rikard 的回答:
Please try adding the following to your functions.php file to see if that helps:
function modify_jquery() { if (!is_admin()) { wp_deregister_script('jquery'); wp_register_script('jquery', 'https://code.jquery.com/jquery-1.11.3.min.js'); wp_enqueue_script('jquery'); } } add_action('init', 'modify_jquery');
把以上代码丢到主题文件夹的functions.php里面,但经过我的实际操作,这样没有效果。于是我想办法找到wp的head引用文件wordpress\wp-includes\general-template.php ?添加进里面就可以了。
好好享受wordpress带来的方便与快捷吧!