<?php if(function_exists("get_field")){?>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel" <?php if(get_field("auto_cycle")==true){?>data-interval="<?php the_field("interval"); ?>"<?php }else{?>data-interval=false<?php }?> data-pause="<?php the_field("pause"); ?>" <?php if(get_field("wrap")==true){?>data-wrap=true<?php }else{?>data-wrap=false<?php }?> <?php if(get_field("keyboard")==true){?>data-keyboard=true<?php }else{?>data-keyboard=false<?php }?>>
            <div id="plancarousel" class="carousel-inner" role="listbox">
            
                	<?php
					$i=0;
					$slides = get_field("slides");
					foreach($slides as $slide){
					$i++;
				$args = array(
						'p'   => $slide,
						'post_type' => 'slide',
						'posts_per_page' => 1);
				 query_posts( $args ); ?>
				<?php while ( have_posts() ) : the_post(); 
				wp_enqueue_style( 'ftl-build-'.get_the_id().'', 'http://localhost/ActiveHost/wp-content/uploads/fl-builder/'.get_the_id().'-layout.css');
				echo '<div class="row-fluid item ';
				if($i==1){echo esc_html("active");}
				echo '">';
                the_content();
				echo '</div>';
        		 endwhile; wp_reset_query();
					}?>
                
            </div>
            <?php if($i > 1){?>
             <!-- Controls -->
              <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
                <span class="glyphicon glyphicon-chevron-left"></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"></span>
                <span class="sr-only">Next</span>
              </a>
              <?php }?>
            </div>
            <?php }?>