广告位招租

九、制作内容页面sidebar

热门排行:

<?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;?>

资源下载
资源下载
0
广告位招租

评论0

广告位招租
没有账号? 注册  忘记密码?