wordpress随机文章显示备份
<div class="reply" id="reply"> <div class="down-detail"><h5>相关随机文章推荐</h5> <?php $args = array( 'numberposts' => 10, 'orderby' => 'rand', 'post_status' => 'publish' ); $rand_posts = get_posts( $args ); foreach( $rand_posts as $post ) : ?> <p style="font-size:12px;width:100%;height:25px;"><span style="float:left;"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></span></a><span style="float:right;"><?php the_time('Y 年 n 月 j 日'); ?></span></p> <?php endforeach; ?> </div> </div>