WordPress:Using Smilies

来自站长百科
Seadragon530讨论 | 贡献2008年4月19日 (六) 13:39的版本
跳转至: 导航、​ 搜索

What Are Smileys?

Smileys, also known as "emoticons," are glyphs used to convey emotions in your writing. They are a great way to brighten up posts. smile emoticon

Smiley是什么?

Smiley,就是大家都知道的"字符组成的图释,"是在写作时用来表达表情的符号。他们是让你的文章更闪亮的好帮手。表情字符

Text smileys are created by typing two or more punctuation marks. Some examples are: 文本Smiley是通过输入两个或者更多的符号组成的,如下:

;-) is equivalent to smile emoticon
:-) is equivalent to smile emoticon
:-( is equivalent to sad emoticon
:-? is equivalent to confused emoticon

To learn more about emoticons and their history, see the Wikipedia entry on Emoticons.

参见Wikipedia Emoticons入门,以找到更多有关emoticon和它的历史信息。

How Does WordPress Handle Smileys?

By default, WordPress automatically converts text smileys to graphic images. When you type ;-) in your post you see smile emoticon when you preview or publish your post.

WordPress是如何管理Smiley的?

默认情况下,WordPress自动转换文本的Smiley为图片,当你输入;-)时,在你的文章中,当你预览或者发布文章时,你可以看到一个微笑图标

To Turn off Graphic Smileys

If you turn off graphic smileys, whatever you type in plain text will remain, and be displayed, as plain text.

  1. Go to your Admin Panel
  2. Select Options > Writing
  3. In the Formatting section, uncheck the box for "Convert emoticons like :-) and :-P to graphics on display"

关闭图形Smiley

如果你关闭了图形Smiley,那么不论你输入什么都只会保留原样显示,象纯文本一样。

  1. 进入管理面板
  2. 选择 Options > Writing
  3. Formatting部分, 不要选中 "Convert emoticons like :-) and :-P to graphics on display"前的复选框就可以了

Turning off emoticons means that when you type ;-) in a post you will see ;-) when you preview or publish your post. So it doesn't stop you from using emoticons as plain text. wink emoticon

关闭emoticon以为着当你输入;-)时,当你预览或者发布文章时,在这个文章中你会看到;-)。所以它不会阻止你使用把emoticons当作纯文本来使用。眨眼

What Text Do I Type to Make Smileys?

Smiley images and the text used to produce them:

应该输入哪些文本来制作Smiley?

Smiley图片和相应的文本*:


icon text text full text icon full text
微笑 :) :-) :smile: 大笑 :lol:
biggrin :D :-D :grin: 脸红 :oops:
悲伤 :( :-( :sad: 哭泣 :cry:
惊讶 :o :-o :eek: 邪恶 :evil:
惊恐 8O 8-O :shock: 苦恼 :twisted:
困惑 :? :-? :???: 翻白眼 :roll:
8) 8-) :cool: 大叫 :!:
疯狂 :x :-x :mad: 疑问 :?:
嘲弄 :P :-P :razz: 思考 :idea:
中立 :| :-| :neutral: 箭头 :arrow:
眨眼 ;) ;-) :wink: 精力旺盛 :mrgreen:

*在有的情况下,多种文本操作可以用来显示同一种smiley.


WordPress:Category:Getting Started

分类:入门

Troubleshooting Smileys

Why Doesn't it Work?

Smileys may have been disabled by your Wordpress admin. Another possibility is the smiley image files have been deleted from /wp-includes/images/smilies.


Smiley问题发现与解决

它为什么不好用呢?

Smiley可能在你的Wordpress管理中被禁用了。另外一种可能是Smiley图片已经从/wp-includes/images/smilies中删除了。

Why Doesn't it Work for Me?

If smileys work for others at your site but not for you:

Type a space before and after your smiley text. That prevents the smiley being accidentally included in the text around it. redface emoticon

Make sure not to use quotes or other punctuation marks before and after the smiley text. rolleyes

为什么只有我不能正常使用呢?

如果别的访问者可以使用你站点上的smiley,但是你却不能使用的话:

在smiley文本之前或后多输入一个空格。可以防止smiley被以外的认为是它周围的别的文本。脸红表情

注意不要在smiley文本之前或之后使用引号或者别的符号。翻白眼

Where Are My Smiley Images Kept?

The smiley or emoticon image graphics are found in the /wp-includes/images/smilies directory.

Note that smileys is spelled 'eys' in this documentation and the directory name for the smiley images is 'smilies, spelled 'ies'. eek emoticon

我的Smiley图片保存在什么地方?

Smiley图片可以在/wp-includes/images/smilies目录下找到。

注意文件中的smileys的拼写是'eys',目录名字是'smilies, 拼写为 'ies'. 惊讶

How Can I Have Different Smiley Images Appear?

Simplest way:

  1. Find your smiley image files in the /wp-includes/images/smilies directory and back them up to another directory
  2. Note the names of each smiley file. Your files must match these names and should be in the same 'gif' image format.
  3. For predictable behavior, the image sizes should be similar.
  4. Upload your new files to the /wp-includes/images/smilies directory with an FTP program.

我如何才可以让不同的Smiley图片显示出来?

最简单的方法:

  1. 找到你的smiley图片文件,它在/wp-includes/images/smilies目录中,把它们备份到另外一个目录中。
  2. 注意每个文件的名字。你的文件必须和这些名字匹配而且必须是同样的'gif'文件图片格式。
  3. 显而易见的, 图片的尺寸应该比较小才可以。
  4. 使用FTP 程序把新文件上传到/wp-includes/images/smilies目录.

If you're up to hacking the code:

If you really must change the file names of the images, edit the file that refers to these images, 'vars.php' (in WordPress 2.2, they're located in 'functions.php'), situated in the /wp-includes/ directory. Follow all precautions when "hacking code".

You can read a tutorial explaining all this in more detail, as well as how to avoid hacking WP code, at Ars Aranea.

There are also WordPress Plugins which allow you to customize your smilies in WordPress.

如果你懂得代码的话:

如果你真的必须更改图片的文件名,编辑指向这些图片的文件,'vars.php' (在WordPress 2.2, 它们在文件'functions.php'中),位于/wp-includes/目录。在"写代码"的时候要小心谨慎。

你可以在Ars Aranea上阅读更详细的指南,同样还有如何避免破坏WP代码。

还有一些WordPress插件允许你用来在WordPress中自定义smilies。

Why are my Smiley Images Blank?

If you recently uploaded the images, it could be that the images have been uploaded in ASCII format by your FTP program. Re-upload the smileys ensuring that they are transferred in BINARY format.

Some FTP programs have an auto-detect setting which will upload files in the correct format without user intervention. If you have such a setting, turn it on.

我的Smiley图片为什么是空白?

如果你最近上传了图片,那可能是你的FTP软件使用了ASCII格式上传了图片,重新上传smiley,确定它们是使用BINARY格式上传的。

一些FTP软件有个auto-detect设置,可以在用户不介入的情况下选择正确的格式上传文件,如果你有这个设置,打开它。

Smiley CSS

The smiley images in WordPress are automatically given a CSS class of wp-smiley when they are displayed in a post. You can use this class to style your smileys differently from other post images.

Smiley CSS

当它们在文章中显示的时候,WordPress 中的Smiley图片会被自动赋予一个CSSwp-smiley类。你可以使用这个类来设计你的Smiley,让它不同于别的文章里的图片。

For example, it's not uncommon to set up images in a post to appear on the left-hand side of the content with text flowing around the image. The CSS for that might look like this:

.post img {
    float: left;
}

例如,在文章中建立图片,让它出现在内容的左手边,并且文字在图片周围漂浮,这可能很少见到。这个效果使用的CSS如下:

.post img {
    float: left;
}

This would typically affect all images in a post, including your smiley images. To override this so that smileys stay inline, you could add this to your CSS:

img.wp-smiley {
    float: none;
}

For more on CSS in WordPress, you might want to start here.

这可能会特别影响到所有的文章里的图片,包括你的smiley图片,要想不理会这个效果的话,让smiley仍然在文本中,可以使用下面的CSS:

img.wp-smiley {
    float: none;
}

More Information on Smileys

有关Smiley的更多信息