今天早上本来以为利用猴哥的 sidebar 文件,找出他的“热评文章”的代码就能把我的“Top Commentded Posts”里的“留言”给去掉。结果这段代码需要“wordpress中文工具箱”这个插件的支持,而北街博客安装这个插件之后首页会产生错乱。于是我决定以wordpress随机文章插件取而代之,这个插件还蛮有用的,可以晾一晾我们的陈谷子烂芝麻。
下载地址:random-posts.zip
使用方法:
1. 解压缩,把 random-posts.php 上传至 /wp-content/plugins/
2. 在管理界面里激活 Random Posts for Chinese 插件
3. 在模板里调用 <?php random_posts(); ?>
4. 调用方式如下:
<? php random_posts ( $limit = 5, $length = 400, $before ='<li>', $after ='</li>', $show_pass_post = false, $show_excerpt_in_title = true ) ;?>
$limit:显示文章数,缺省5篇;
$length:摘要长度,缺省400;
$before:每条记录前显示的文字,缺省<li>
$after:每条记录后显示的文字,缺省</li>
$show_pass_post:是(true)/否(false)显示保护了的文章,缺省否(false)
$show_excerpt_in_title:是(true),摘要显示于文章链接的title;否(false),直接显示于页面;缺省是(true)


试试去,谢谢博主
good
不错,学习了,正好用得上~
学到东西了,得试试
Unknown message
You have a great website! I would love to build backlinks for you.
我正想找这个插件用呢,谢谢分享。