WordPress 调用随机文章
1 2 3 | <?php $rand_posts = get_posts('numberposts=10& category=1&orderby=rand');foreach($rand_posts as $post) : ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endforeach;?> |
category—调用分类
orderby—-排列方式