Home » Wordpress 技巧

如何给你的WordPress主题加上评论数目

一般的博客都希望越多人发表评论越好(不过我想谁也不喜欢垃圾评论)。要想你的博客变得热门,除了写出好的文章以外,稍微的利用一下小小的技巧可能会有意想不到的效果。

一般情况下,当读者来到你的博客时看见你的文章有这么多人发表评论,他们也会忍不住说两句。所以,显示评论数目将能让读者更直观的知道文章的流行程度。就算你的文章只有很少的人发表评论,但如果你在文章的某个位置加上这么一个按钮,也会使提升读者发表评论的可能性。

下面就是两种在WordPress主题添加文章评论数目的方法:

第一种是直接显示评论数目,当你的主题加上这行代码以后,读者点击它就可以直接到文章评论区

<?php comments_number(‘No comments yet’,’1 comment’,'% comments’)?>

第二种代码的作用相当,不过如果你去掉了代码中的“<?php comments_number(‘No comments yet’,’1 comment’,'% comments’)?>”部分的话,显示出来的效果就没有评论数目了,而是一个到文章评论区的连接(预览请看WordPress 賺钱博客的首页),你可以用“发表评论”等字眼来代替上面的代码

<a href=”<?php the_permalink() ?>#comments”><?php comments_number(‘No comments yet’,’1 comment’,'% comments’)?></a>

目前我就知道这两种方法来显示文章评论数目,你是否还有其他更好的方法呢?

Popularity: 1% [?]

Share/Bookmark this!

2 Comments

Leave a reply

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally recognized avatar, please register at Gravatar.

Side Notes

This entry was posted by on December 31, 2008 at 6:36 pm and filed under Wordpress 技巧 category.

You can add your comments or trackback from your own site. To keep you updated to the latest discussion, you can subscribe to these comments via RSS.

This is a Gravatar-enabled weblog. To get your own globally recognized avatar, please register at Gravatar.

最新文章

最新评论

Tag Cloud

301 Redirect 301重定向 2010 about All in one seo pack AutosCraze blog CSS Darren feed FreshMag Global Translator Google GreenFun HTML Insider name.com Problogger robots.txt文件 RSS Feed seo Wordpress Wordpress 主题 Wordpress主题 代码 优惠码 关于 博客 博客建设 域名 工具 建设 技巧 提交 插件 文章 杂志型主题 标签 注册 绿色 网赚 评论 选择 链接 页面