Forums

Random post code not working with 3.0.1? (1 post)

  1. thebradmiskell
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic