多试试:多试试-计算机技术与软件
php
http://www.wordpress.la/display-random-posts-without-plugin.html
html
一般咱们能够经过Random Pages Widget插件来实现随机文章的显示,不过若是不想涉及插件,下面的代码也能够调用出随机文章哦。dom
<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>