WordPress无插件添加表情

上回在万戈那发现了Wordpress原来本身就自带有表情以及如何使用相应代码来添加表情后。后来在另一牛人Willin Kan的博客上看到其评论上方直接就可以点击添加表情,本来是想满问问能不能放出来共享,没想到第二天真的就发出来了。

今天也在自己的blog上添加了这个功能(当然,原作者使用了js特效,更酷点),顺便也转过来,好东西大家共享,顺便记下来,以后有修改不用到处找。

在 WorPress 弄上表情符號已不是什麼新鮮事了, 但要小而不用插件, 就用這個吧! 它會在評論框上面出現所有表情圖片, 可供訪客直接挑用.

下載 smiley.zip 解壓縮後, 將 smiley.php 放在模板所在的路徑.

然後在 comments.php 及 guestcomments.php 的 textarea 之前的適當位置, 放上:

<?php include(TEMPLATEPATH . '/smiley.php'); ?>

如此而已~~

如果要修改表情图片,用editplus打开smiley.php文件看看就知道怎么修改了,wp自带的表情也不错,呵呵。

作者: LMS

天行贱,君子自强自息。

标签

《WordPress无插件添加表情》有24个想法

  1. 给我换个,可爱好看点的头像吧!现在这个头像啥意思啊?怎么看都看不明白!

    1. @xiran 这个头像是根据你提供的email地址自动生成的,我不知道怎么改啊,不过可以交你怎么改,到http://www.gravatar.com这里用你邮箱地址注册一下上传一个你喜欢的头像就OK了。

    1. @GRAM 这个代码只在ie下有效的,而且自从我直接在数据库里改了一篇文章的id后,复制出来的ID都不准确了,我准备去掉这个东西了。

  2. 哥哥测试下CSS+DIv英文会不会有变形

    “The empire, long divided, must unite; long united, must divide. Thus it has ever been.” Echoing the rhythms of Chinese history itself, the monumental tale Three Kingdoms begins. As important for Chinese culture as the Homeric epics have been for the West, this fourteenth-century masterpiece continues to be loved and read throughout China today. Three Kingdoms portrays a fateful moment at the end of the Han Dynasty (206 B.C.-A.D. 220) when the future of the Chinese empire lay in the balance. Fearing attacks by three rebellious states, the emperor sent out an urgent appeal for support. In response, three young men – the aristocratic Liu Xuande, the fugitive Lord Guan, and the pig butcher Zhang Fei – met to swear eternal brotherhood and fealty to their beleaguered country. Their vow set in motion the series of events that ultimately resulted in the collapse of the Han. Writing centuries later, Luo Guanzhong drew on, often-told tales of this turbulent period to fashion a sophisticated narrative of loyalty and treachery, triumph and defeat, that came to epitomize all that was best and worst in the life of his country. Illustrated.

  3. 你好。为什么我按照你的方法,表情图怎么都显示不出来。可以点击,可以使用表情,就是不现实图片

发表评论

电子邮件地址不会被公开。 必填项已用*标注