<ul>
<?php $post_query = new WP_Query(‘showposts=10′);
while ($post_query->have_posts()) : $post_query->the_post();
$do_not_duplicate = $post->ID; ?>
<li><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></li>
<?php endwhile;?>
</ul>
<ul>
<?php
$post_num = 10; // 设置调用条数
$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(); ?>
<li><a href=”<?php the_permalink(); ?>” title=”<?php the_title(); ?>”><?php the_title(); ?></a></li>
<?php } wp_reset_query();?>
</ul>
<ul>
<?php
global $post;
$postid = $post->ID;
$args = array( ‘orderby’ => ‘rand’, ‘post__not_in’ => array($post->ID), ‘showposts’ => 10);
$query_posts = new WP_Query();
$query_posts->query($args);
?>
<?php while ($query_posts->have_posts()) : $query_posts->the_post(); ?>
<li><a href=”<?php the_permalink(); ?>” rel=”bookmark” title=”<?php the_title_attribute(); ?>”><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
以上就是安达网络工作室关于《WordPress无插件调用**、热门、随机文章实例代码》的一些看法。更多内容请查看本栏目更多内容!
明天吃完午饭,劳动劳动,最近搞了一下google adsense,不过最终的审核没经过,我想会不会是界面不难看呢,...
用动态化当然能够处理这些成绩,不过关于流量不大的博客就没必要了。 wordpress自带有缓存体系,要害的函数...
但惋惜的是,目前wordpress主题中95%以上是本国人写的,其设计是基于东方文字的,中国的blogger将这些主题拿...
即便你的博客治理后盾的治理员身份被人破解了,普通他也不会同时破解你的网站空间ftp账号,所以他也更改不了...
本文实例讲述了wordpress调用以后分类下子分类的办法。分享给大家供大家参考。详细剖析如下: 本人没用过wo...
wordpress头部的代码十分多,包括WordPress版本,前后文、第一篇文章、主页meta信息等各种冗余代码,这些对...