Skip to content

Instantly share code, notes, and snippets.

@shahadat014
Created January 18, 2015 19:04
Show Gist options
  • Select an option

  • Save shahadat014/9298c6a91d588f562f15 to your computer and use it in GitHub Desktop.

Select an option

Save shahadat014/9298c6a91d588f562f15 to your computer and use it in GitHub Desktop.
Dynamic bootstrap carousel bullets
<?php
global $post;
$number = 0;
$args = array( 'posts_per_page' => -1, 'post_type'=> 'posttype', 'orderby' => 'menu_order', 'order' => 'ASC' );
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<li data-target="#myCarousel" data-slide-to="<?php echo $number++; ?>"></li>
<?php endforeach; ?>
@hemusyl
Copy link

hemusyl commented Nov 14, 2015

This code does not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment