常用 WP 插件的引用代码

12 views
Skip to first unread message

Xu.hel

unread,
Jan 15, 2008, 1:25:40 AM1/15/08
to WordPress的应用
首先声明这是一个资源收集贴。
发这个帖子只是想方便代码的编写。欢迎补充。

代码如下

# RThanks

1、下载 rthanks 插件,上传到 plugins 目录,激活它。
2、在模板 single.php 中适当位置 (建议在 the_content 上面一行) 添加如下代码:
<? refer_thanks(); ?>

提示:如果想修改以上文字内容,打开插件 rthanks.php,编辑第 23 行。

---

# Related Posts Plugin
<?php /* Related Posts Plugin */ if
((function_exists('st_related_posts')) and is_single() and ($notfound !
= '1')) { ?>
<?php st_related_posts() ?>
<?php } ?>

---

# WP23 Related Posts

相关日志插件为读者提供了方便有效的阅读导引, 原插件由 我爱水煮鱼 提供,
在templates中(index.php和single.php) 增加
<?php if ( function_exists(’wp23_related_posts’))
wp23_related_posts(); ?>

---

# popularity-contest
这段代码来自 Nicky 的主题
<?php /* Most Popular in Category */ if (is_category()) { ?>
<?php single_cat_title(); ?> <?php _e('分类中最受欢迎文章','shining'); ?>
<?php akpc_most_popular_in_cat(); ?>
<?php } ?>

<?php /* Most Popular in Archive */ if (is_archive() && is_month())
{ ?>
<?php the_time('F, Y'); ?> <?php _e('最受欢迎文章','shining'); ?>
<?php akpc_most_popular_in_month(); ?>
<?php } ?>

<?php if (function_exists('akpc_most_popular_in_month')) { ?>
<?php if (is_home()) { ?><?php _e('本月最受欢迎文章','shining'); ?><?php } ?
>
<?php if (is_single()) { ?><?php _e('当月最受欢迎文章','shining'); ?><?
php } ?>
<?php if (!is_home() and !is_single()) { ?><h3><?php _e('最受欢迎文
章','shining'); ?><?php } ?>
<?php akpc_most_popular_in_month(); ?>
<?php } ?>

<?php if ((function_exists('get_recent_comments')) and is_home()) { ?
>
<?php _e('最近评论','shining'); ?>
<?php get_recent_comments($no_comments = 6); ?>
<?php } ?>

---

# wp_pagenavi

<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
Reply all
Reply to author
Forward
0 new messages