热门排行:
<?php
$post_num = 9; // 设置调用条数
$args = array(
‘post_password’ => ”,
‘post_status’ => ‘publish’, // 只选公开的文章.
‘post__not_in’ => array($post->ID),//排除当前文章
‘caller_get_posts’ => 1, // 排除置頂文章.
‘orderby’ => ‘comment_count’, // 依評論數排序.
‘posts_per_page’ => $post_num
);
$query_posts = new WP_Query();
$query_posts->query($args);
while( $query_posts->have_posts() ) { $query_posts->the_post(); ?>
<a href=”<?php the_permalink(); ?>” title=”<?php the_title(); ?>”>
<?php the_title(); ?></a><br/>
<?php } wp_reset_query();?>
随机推荐:
<?php $rand_posts = get_posts(‘numberposts=9&orderby=rand’);foreach($rand_posts as $post) : ?>
<a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a><br/>
<?php endforeach;?>
最新文章:
<?php $rand_posts = get_posts(‘numberposts=9&orderby=date’);foreach($rand_posts as $post) : ?>
<a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a><br/>
<?php endforeach;?>
原文链接:https://i.haogew.cn/196.html,转载请注明出处~~~
评论0