Created
March 10, 2015 15:37
-
-
Save jhouedanou/24bc84235b5e8dd3529c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment