2014-02-07 70 views
0

我使用Bootstrap构建的Wordpress模板有问题 - 脚本不起作用,例如下拉菜单...我相信我按照说明正确地做了一切。但我不知道为什么我的Bootstrap想要加载“资产”文件夹,虽然在该版本(3.1.0)没有这样的文件夹。Bootstrap 3.1.0不加载脚本?

位置与引导文件我的主题文件夹中,它看起来像:

http://localhost:8888/my-site/wp-content/themes/my-theme/ 

我的控制台说:

Failed to load resource: the server responded with a status of 404 (Not Found) 
http://localhost:8888/assets/js/bootstrap-transition.js 
http://localhost:8888/assets/js/bootstrap-alert.js 
http://localhost:8888/assets/js/jquery.js 
http://localhost:8888/assets/js/bootstrap-modal.js 
http://localhost:8888/assets/js/bootstrap-dropdown.js 
http://localhost:8888/assets/js/bootstrap-scrollspy.js 
http://localhost:8888/assets/js/bootstrap-tooltip.js 
http://localhost:8888/assets/js/bootstrap-tab.js 
http://localhost:8888/assets/js/bootstrap-popover.js 
http://localhost:8888/assets/js/bootstrap-button.js 
http://localhost:8888/assets/js/bootstrap-collapse.js 
http://localhost:8888/assets/js/bootstrap-typeahead.js 
http://localhost:8888/assets/js/bootstrap-carousel.js 

在我的style.css主题文件我已经得到了有关唯一信息主题和此行的作者:@import url('css/bootstrap.min.css');

反过来,我的header.php文件只包含:

<link href="<?php bloginfo('stylesheet_url');?>" rel="stylesheet"> 

回答

0

你是如何加载脚本的?您指出如何加载样式表,但不是脚本本身。通常引导程序模板喜欢将它们包含在页脚中。

+0

你是老板:)该模板包含在footer.php中的脚本。但现在出现了这个问题......如何加载这些脚本,例如引导-dropdown.js?导致我的下拉导航栏仍然无法正常工作... – Adam

+0

我想你需要更新'footer.php'中的路径。您始终可以使用Firebug检查脚本是否正在加载。 – AnuragBabaresco

+1

事情是在开始时添加最新版本的jquery,当然也添加了bootstrap.min.js。 :) – Adam