在WordPress中显示随机文章
March 15th, 2009 | by Shaka |函数是这样的:
<ul><li><h2>A random selection of my writing</h2>
<ul>
<?php
$rand_posts = get_posts('numberposts=5&orderby=rand');
foreach( $rand_posts as $post ) :
?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
</li></ul>
具体的在这里:http://codex.wordpress.org/Template_Tags/get_posts
分类:南边是技术标签: Wordpress