WordPress 没有删除 Bootstrap 的“in”折叠类
Posted
技术标签:
【中文标题】WordPress 没有删除 Bootstrap 的“in”折叠类【英文标题】:WordPress isn't removing Bootstrap's collapse class 'in' 【发布时间】:2014-11-20 11:38:39 【问题描述】:我正在使用 Bootstrap 折叠区域来隐藏信息,直到面板折叠。我必须向您展示我的网站,因为我无法在 JSfiddle 中重新创建问题,因为它可以在那里工作,但不能在我的网站上......
我最近为这个网站制作了一个 WordPress 主题,虽然崩溃在静态网站上有效,但它在 WordPress 中不起作用。看一看: jsfiddle ---- the wordpress site
<!-- g3 -->
<div class="row">
<div class="well main-wells">
<h2 class="text-center"><a href="javascript:void(0)" data-toggle="collapse" data-target="#g3">About</a></h2>
<div id="g3" class="collapse g3">
<div class="container-fluid">
<div class="col-sm-6">
<img src="<?php get_template_directory_uri() ?>/assets/img/me.png" class="img-responsive" >
</div>
<div class="col-sm-6">
<p>I combine technology and design to make great user experiences. Having worked in different businesses in various roles, I am accustomed to rapidly changing technology. I enjoy working in challenging environments and learning new technology. Over the years, I learned to meet my objectives through organization and contributing creativity, knowledge, and recommendations based on the needs of the task.</p>
<hr><h4>Mission</h4>
<blockquote>To produce innovative, value intensive products by cultivating my creativity and capabilities with dedication, while always supporting the bigger, common goal.</blockquote>
</div><!-- row -->
</div>
</div> <!-- g3/collapse -->
</div><!-- well -->
</div><!-- row -->
<!-- g3 end -->
当您单击按钮时,面板会打开,但当您再次单击时,“in”类不会按原样删除。
知道为什么'in' 类不会像在 JSfiddle 中那样在 WP 网站上删除。 ?
【问题讨论】:
如果此代码适用于小提琴,但不适用于您的网站,那么它与此代码无关。 【参考方案1】:在您的网站中,您多次调用脚本,包括一些 404。
404 块:
Failed to load resource: the server responded with a status of 404 (Not Found) http://omarhabash.com/wp/assets/css/bootstrap.min.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://omarhabash.com/wp/assets/css/style.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://omarhabash.com/wp/assets/plugins/grid/component.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://omarhabash.com/wp/assets/js/modernizr.custom.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://omarhabash.com/img/star.png1
Consider using 'dppx' units, as in CSS 'dpi' means dots-per-CSS-inch, not dots-per-physical-inch, so does not correspond to the actual 'dpi' of a screen. In media query expression: (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi)
然后在你的脑海中你有你两次调用像modernizr这样的脚本
然后在您的<footer>
中,您拥有在您的<head>
中调用的相同脚本。只需清理您的网站,它应该可以正常工作
【讨论】:
以上是关于WordPress 没有删除 Bootstrap 的“in”折叠类的主要内容,如果未能解决你的问题,请参考以下文章
如何在 wordpress 主页上加载 Bootstrap **仅限**
如何仅在 wordpress 主页上加载 Bootstrap
WordPress - 如何使用 Bootstrap 4.5 在工具提示中添加 HTML?