Description:Displays the popular posts based on comments, you can use Custom Fields.
使用方法:
1.下载后解压上传至/wp-content/plugins/目录,
Upload this directory to your plugins directory to the /wp-content/plugins/ directory
2.进入后台控制板,激活插件;
Activate the Plugin via the Plugins section at your WordPress admin panel.
3.在你的模板中使用插入inside your template.
<?php if(function_exists('popularbycomments')) { popularbycomments();};?>
4.高级使用
<?php if (function_exists('popularbycomments')) {
popularbycomments('<li><h5>Popular posts</h5><ul>',
10,
'no',
'<li class="%No%"><a href="%post_url%"><img src="%post_meta%"/>%post_title%</a> %comments% comments</li>',
'</ul><a href="%moreurl%">more popular</a></li>',
'index_image',
'http://localhost/juqng/wp-content/uploads/2009/03/il18.jpg',
'http://localhost/juqng/index.php/popular-items/');
}
?>
参数含义依次为:
1.热门文章列表前代码;
2.显示文章数量;
3.单个文章列表递曾类名如:no1,no2,no3...;
4.每个列表输出格式;
5.结尾更多页链接输出格式;
6.自定义字段名称;
7.自定义字段值默认替换;
8.更多链接地址。
输出格式介绍:%No%为类名;%post_url%日志地址;%post_meta%自定义字段值(Custom Fields),%comments%评论数量;%moreurl%更多链接地址,%post_title%日志标题;
Requires: 2.7.1 or higher
Compatible up to: 2.7.1
Last Updated: 2009-3-6
Downloads: 541
Got something to say? Need help?