Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery未加载到除首页-Wordpress之外的任何页面_Jquery_Wordpress_Lightbox - Fatal编程技术网

jQuery未加载到除首页-Wordpress之外的任何页面

jQuery未加载到除首页-Wordpress之外的任何页面,jquery,wordpress,lightbox,Jquery,Wordpress,Lightbox,我正在构建一个wordpress主题,其中jQuery似乎只出现在头版 我尝试过使用functions.php文件,将其从: wp_enqueue_script('jquery'); 致: 正如我通过谷歌所读到的,尽管它似乎没有改变任何东西,但无论我在其中添加了什么,我似乎都无法在单个页面上使用任何插件 你可以看到一个例子,我的单页,我有麻烦,在 这些图像应该在一个灯箱中打开。如果您在上签出站点的根目录并单击公文包缩略图,它将通过ajax加载,lightbox功能工作正常 你知道是什么导致j

我正在构建一个wordpress主题,其中jQuery似乎只出现在头版

我尝试过使用functions.php文件,将其从:

wp_enqueue_script('jquery'); 
致:

正如我通过谷歌所读到的,尽管它似乎没有改变任何东西,但无论我在其中添加了什么,我似乎都无法在单个页面上使用任何插件

你可以看到一个例子,我的单页,我有麻烦,在 这些图像应该在一个灯箱中打开。如果您在上签出站点的根目录并单击公文包缩略图,它将通过ajax加载,lightbox功能工作正常


你知道是什么导致jQuery只在首页上加载吗?single-projects.php页面加载header.php和footer.php文件,其中wp_head();和wp_footer();都已定位。

jQuery已经包含在Wordpress中,您不必在任何地方链接,只需排队,为什么不在管理页面中包含jQuery,这真的很重要吗?我在CSS-tricks.com上尝试了这段代码,尽管不管怎样,它在singles页面上不起作用,只是在头版,所以我不认为这与我的问题有任何关系。
if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);  
function my_jquery_enqueue() {  
   wp_deregister_script('jquery');  
   wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false, null);  
   wp_enqueue_script('jquery');  
}