0

I have a twitter Bootstrap carousel that I am trying to use within wordpress and it is stacking all the pictures on top of each other and doesn't rotate.

You can view it and see what I mean here.

My code looks like this:

<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
  <!-- Indicators -->
  <ol class="carousel-indicators">
    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
    <li data-target="#carousel-example-generic" data-slide-to="1"></li>
    <li data-target="#carousel-example-generic" data-slide-to="2"></li>
  </ol>

  <!-- Wrapper for slides -->
  <div class="carousel-inner" role="listbox">
    <div class="item active">
      <img src="http://i0.wp.com/www.cattywampur.com/wp-content/uploads/2016/03/8566819595_0f567e8594_k.jpg" >
      <div class="carousel-caption">
        <h3>Traversing the Grand Canyon</h3>
      </div>
    </div>

  <div class="carousel-inner" role="listbox">
    <div class="item active">
      <img src="http://i2.wp.com/www.cattywampur.com/wp-content/uploads/2016/05/26300985983_713ab03dc1_k.jpg" >
      <div class="carousel-caption">
        <h3>San Jacinto - Deer Springs Trail</h3>
      </div>
    </div>



  </div>

  <!-- Controls -->
  <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>
Mike
  • 6,751
  • 23
  • 75
  • 132

1 Answers1

1
  • You only need one carousel-inner.
  • And one item set to active.

That way they don't stack and have the same wrapper.

<div class="carousel-inner" role="listbox">

  <div class="item active">
    <img src="http://i0.wp.com/www.cattywampur.com/wp-content/uploads/2016/03/8566819595_0f567e8594_k.jpg">
    <div class="carousel-caption">
      <h3>Traversing the Grand Canyon</h3>
    </div>
  </div>

  <div class="item">
    <img src="http://i2.wp.com/www.cattywampur.com/wp-content/uploads/2016/05/26300985983_713ab03dc1_k.jpg">
    <div class="carousel-caption">
      <h3>San Jacinto - Deer Springs Trail</h3>
    </div>
  </div>

</div>
AA2992
  • 1,559
  • 3
  • 17
  • 23
  • Awesome that fixed it thanks! Now that its "working" I thought the carousel would have been more responsive.... The pictures I have in there are kind of off centered. – Mike Sep 18 '16 at 06:09
  • It is responsive. As in slider resizes relative to the viewport. But it forces a width of `100%` to achieve this and makes height auto on all the images. Just to avoid stretching them out. You can probably try some tricks from here. [Diff height Images / Stackoverflow](http://stackoverflow.com/q/13391566/5496966) – AA2992 Sep 18 '16 at 06:20