คำสั่ง random post จาก categories ของ post ปัจจุบัน
<?php /* assign the variable as current category */ ?>
<?php $categoryvariable = $cat;?>
<?php /* concatenate the query */ ?>
<?php $args = 'cat=' . $categoryvariable . '&rand&showposts=8'; ?>
<?php /* run the query */ ?>
<?php $posts = query_posts($args); foreach($posts as $post) { ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
<?php } ?>
credit: http://www.thaiseoboard.com/index.php?topic=259184.0