如何向wordpress评论和文字中添加QQ表情 (已有2,033人浏览)
大家先大概的看看下面这篇英文文章,然后我给大家说怎么安装。(按照下面英文文章的步骤安装会失败的,所以需要看我最后的说明,本人亲自测试通过)(正确安装教程在文章下方(中文版,不要担心))
Smilies, also known as “emoticons”, are glyphs used to convey emotions in your writing. They are a great way to brighten up posts.
If you want to attract more visitors to comment on your blog, adding smilies is an effective method.
Here is the screenshots in comment area of my blog:

For more information about smilies of WordPress, please check WordPress Codx (http://codex.wordpress.org/Using_Smilies )
I will introduce two easy ways to add your own smilies to your WordPress blog
1. WordPress Plugins
I personally recommend use Custom Smilies SE ( author’s blog page ) as your WordPress Smilies Plugin, because you can add your own smilies images on your blog:

Also, you can add smilies when posting in WordPress dashboard:

There are many other WordPress smilies plugins:
http://www.blogsdna.com/914/top-10-best-wordpress-smilies-plugins-for-your-blog.htm
2. Using a simple php script
Many other bloggers, just like me, don’t like using plugins but want to customize your WordPress themes.
Usually, a WordPress plugin may increase your MySQL database size, so not using a plugin is a good habit.
Now, let me tech you how to do it without a WordPress plugin.
First, download this php sript:
http://files.they.re/uploads/smiley.zip
本站备份:http://super.yupengyang.com/wp-content/uploads/2010/09/smiley.zip
Then, upload smiley.php to your themes folder, such as /wp-content/themes/default/smiley.php
Now, go to your WordPress dashboard to edit comments.php of your themes ( appearance ), insert this line where you find textarea in your comments.php:
<?php include(TEMPLATEPATH . ‘/smiley.php’); ?>
( Normally insert it below or above these code: textarea name=”comment” )
So easy, isn’t it?
This simple php script is modified by Willin Kan.
3. Download QQ Emotions files
You may notice that the smilies images on my blog are special, it is from Tencent (QQ.COM, a Chinese IM software).
Now you can download it from my blog:
V1 Round Face (from original QQ)
![]()
V2 Square Face
![]()
Download: Round Face | Square Face
(Replace the image files in /wp-includes/images/smilies/ )
———————————————————————————————————————————-
看完上面这些,我来告诉大家怎么安装(下面的是重点):
1.安装Custom Smilies SE 插件,然后激活。
2.把下面的代码,添加到你正在使用的主题的comments.php文件当中,添加到你喜欢的地方,比如说添加到submit按钮之前。
<?php if ( function_exists(cs_print_smilies) ) {cs_print_smilies();} ?>
3.按照上面英文步骤3替换原来的表情为QQ表情。
到此,这才在wp的评论当中成功添加了QQ表情,以后有人评论你的文章,就可以使用上很有意思的QQ表情。多有意思呀。
演示:比如本页面的评论部分,就是用该方法添加的QQ表情。
本文原创,本站采用创作共用版权协议, 要求署名、非商业用途和保持一致. 转载本站内容必须也遵循“署名-非商业用途-保持一致”的创作共用协议. 作者:飞翔的翅膀pp
本文原始地址:http://yupengyang.com/cn/blog/add-qq-smilies-to-your-wordpress-blog.html
我要分享这篇文章
里面的内容学习了,希望能和你交换链接,你的我已经加上了