• Hello there. My apologies if there’s a similar post to mine.
    I am trying to have only one category displayed with posts with thumbnails BUT I want them showing in random order.
    I have managed to get the first part right. I have the posts in one selected category showing in thumbnails.
    But I don’t know how to do the random bit. I am very new to this whole malarkey!

    <?php
    $tab['cat']=15;
    $tab['showposts']=15;
    query_posts($tab);
    unset($tab);
    
    if(have_posts()==TRUE) {
    ?><ul><?php
    while(have_posts()==TRUE) {
    the_post();
    
    if(has_post_thumbnail()==TRUE) {
    ?><li title="<?php the_title() ?>"><a href="<?php the_permalink() ?>"><?php the_post_thumbnail('artistes_gallery'); ?></a></li>
    
    <?php
    } }
    ?></ul><?php
    }
    
    wp_reset_query();
    ?>

    Thank you in advance!

    You can see it all here: https://www.deschosesadire.net/

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘posts with thumbnails for 1 category in random order’ is closed to new replies.