• I’ve successfully used the following code to feature random posts in a div on several clients’ home pages. It suddenly stopped working recently. I have no idea whether upgrading to 3.0.1 may have been a cause, but in each case, I believe it to have been after I upgraded.

    Here’s the code that always worked before:

    <?php $my_query = new WP_Query(‘showposts=1&orderby=rand&cat=5’); ?>
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>

    I have not tried going back to 3.0 or 2.9, though I know that might be indicated.

    Thanks for any insight.

  • The topic ‘Random post code not working with 3.0.1?’ is closed to new replies.