i wrote bit php bootstrap carousel
<?php if( magic_get_attachment() ): $attachments = magic_get_attachment(7); //var_dump($attachments); ?> <div id="post-gallery-<?php the_id(); ?>" class="carousel slide" data-ride="carousel"> <div class="carousel-inner" role="listbox"> <?php $i = 0; foreach($attachments $attachment): $active = ($i == 0 ? ' active' : ''); ?> <div class="item<?php echo $active; ?> background-image standard-featured" style="background-image: url(<?php echo wp_get_attachment_url( $attachment->id ); ?>);"></div> <?php $i++; endforeach; ?> </div><!-- .carousel-inner --> </div><!-- .carousel --> <?php endif; ?>
when inspect in chrome, can see images have been stored
but seems carousel not sliding. wrong code? thx.
problem solved.
bootstrap carousel cannot along jquery version higher 3.
Comments
Post a Comment