vendredi 26 juin 2015

Wordpress – Random post order

I want to have a random post order, but it does not work: The order of the posts is still by date. Can you help me?

http://ift.tt/1eLWo0C

<!-- T H E   L O O P -->  


<?php query_posts(array('post_type' => 'post', 'orderby' => 'rand', 'posts_per_page' => -1)); ?>
<?php if ( have_posts() ): $i = 0;  ?>

<?php while ( have_posts() ) : the_post(); $i++; ?>

<div class="article-content <?php if ($i % 7 == 0) echo 'seventhclass'?>" id="post-<?php the_ID(); ?>">

<div class="article-thumb">

<?php the_content(); ?>


<!-- Close article-thumb -->
    </div>

<!-- Close article-content -->

</div>

<?php endwhile; ?>


 <!-- /T H E   L O O P -->  




Aucun commentaire:

Enregistrer un commentaire