Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="leloopofdeath" class="cycle-slideshow"
- data-cycle-slides="li"
- data-cycle-fx=carousel
- data-cycle-speed="1000"
- data-cycle-pause-on-hover="true"
- data-cycle-carousel-visible=3
- data-cycle-prev="#prev3"
- data-cycle-next="#next3">
- <!--compter le nombre de posts dans la categorie themes-->
- <?php
- $postsInCat = get_term_by('name','themes','category');
- $postsInCat = $postsInCat->count;
- //variable avec le nombre total de posts
- $limite = 15;
- $limitwhile = intval($postsInCat/$limite);
- //echo $limitwhile;
- ?>
- <!--premiere loop-->
- <?php
- $do_not_duplicate = array();
- $i= 1;
- while($i <= $limitwhile) {
- ?>
- <?php $mosaics = new WP_Query(array('category_name'=>'themes','posts_per_page'=> 15, 'post__not_in' => $do_not_duplicate ) ); ?>
- <?php if ( have_posts() ) :?>
- <?php echo '<li id="contenu'.$i.'" class="leflah">'?>
- <?php while ($mosaics->have_posts()) : $mosaics->the_post(); ?>
- <?php $do_not_duplicate[] = $post->ID; ?>
- <a href="<?php the_permalink();?>">
- <?php the_title(); ?>
- </a>
- <?php endwhile; ?>
- <?php echo '</li>'?>
- <?php else :?>
- <!--ne rien afficher-->
- <?php endif; ?>
- <?php wp_reset_postdata();
- ?>
- <?php
- $i++;
- }
- ?>
- </div><!--leloopofdeath-->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement