<?php
    $countCalendarioItems = 0;
    $args = array();
    $sites = get_sites($args);
?>

<div id="carouselCalendario" class="carousel slide" data-interval="false" data-ride="false" data-touch="true">
    <div class="carousel-inner">
        <?php
            foreach ($sites as $site) {
                switch_to_blog($site->blog_id);
                $facebookLink = get_option( 'u99_rs_facebook', true );
                if($facebookLink){
                    $idCarousel = 'carouselCalendarioItem_'.$countCalendarioItems;
                    $listaContenido[$idCarousel] = array(
                        'sitio_id' => get_current_blog_id(),
                        'post_id' => '-1',
                        'tipo' => 'calendario',
                        'fuente' => 'facebook'
                    );
                    ?>
                    <div id="<?php echo $idCarousel;?>" class="carousel-item <?php if ($countCalendarioItems===0){echo "active";} ?> tarjeta-timeline">
                        <?php //include( locate_template( 'template-parts/content/content-calendario-inner.php', false, false ) ); ?>
                        <div class="carousel-item-inner"></div>
                        <div class="carousel-caption d-md-block">
                            <h5><?php bloginfo( 'name' ); ?></h5>
                        </div>
                    </div>
                    <?php
                    $countCalendarioItems++;
                }
                restore_current_blog();
            }
        ?>
        <ol class="carousel-indicators">
            <?php
                for($j=0;$j<$countCalendarioItems;$j++){
                    ?><li data-target="#carouselCalendario" data-slide-to="<?php echo $j; ?>" class="<?php if($j===0){ echo ' active';} ?>"></li><?php
                }
            ?>
        </ol>
    </div>
</div>
<div class="content-controls-carrusel" >
    <a class="carousel-control-prev" href="#carouselCalendario" role="button" data-slide="prev">
        <span class="carousel-control-prev-icon" aria-hidden="true"></span>
        <span class="sr-only">Previous</span>
    </a>
    <a class="carousel-control-next" href="#carouselCalendario" role="button" data-slide="next">
        <span class="carousel-control-next-icon" aria-hidden="true"></span>
        <span class="sr-only">Next</span>
    </a>
</div>


  