WIKI使用導(dǎo)航
站長百科導(dǎo)航
站長專題
- 網(wǎng)站推廣
- 網(wǎng)站程序
- 網(wǎng)站賺錢
- 虛擬主機(jī)
- cPanel
- 網(wǎng)址導(dǎo)航專題
- 云計算
- 微博營銷
- 虛擬主機(jī)管理系統(tǒng)
- 開放平臺
- WIKI程序與應(yīng)用
- 美國十大主機(jī)
WordPress:Fun Character Entities
Character Entities or Extended Characters
In many WordPress sites, you will see odd symbols that will pop up from time to time. Often these symbols appear in navigation links. For instance, look at the the double left angle quotes («) and the double right angle quotes (») in this example:
These symbols are called HTML character entities or extended characters. They are generated by strange looking code on the web page that the web browser interprets as symbols.
文字實體或者擴(kuò)展文字
在許多WordPress站點上,你可以看到單個的符號有時突然出現(xiàn)。通常這些符號出現(xiàn)在導(dǎo)航連接上。舉個例子,看這個例子中的書名號(«)和(»):
這些符號叫做HTML 文字實體或者叫做擴(kuò)展文字.它們是通過一些網(wǎng)頁上看起來很奇怪的,瀏覽器認(rèn)為是符號的代碼生成的。
The code that generated the above example looks like this:
<?php previous_post('« « %', '', 'yes'); ?> | <?php next_post('% » » ', '', 'yes'); ?>
生成上述例子的代碼如下:
<?php previous_post('« « %', '', 'yes'); ?> | <?php next_post('% » » ', '', 'yes'); ?>
Some of the most popular HTML character entities are:
一些最流行的HTML 文字實體為:
- » » double right angle quote
- « « double left angle quote
- < < single left arrow
- > > single right arrow
- • • bullet
- ♥ or ♥ ♥ black heart
- ♦ or ♦ ♦ black diamond
- ♣ or ♣ ♣ black clubs (shamrock)
- ♠ or ♠ ♠ black spade
- ∞ ∞ infinity symbol
- — — long dash
Using Character Entities in WordPress
Using character entities can be a fun part of your design! You can use these special accents with template tags such as the the_category() tag. Note: the_category() template tag lists, in post meta data section, the various categories assigned to a post.
在WordPress中使用文字實體
使用文字實體是設(shè)計中一個有趣的部分!你可以在模板標(biāo)簽中使用這些特殊符號,如the_category()標(biāo)簽。注意:the_category() 模板標(biāo)簽列表,在文章meta數(shù)據(jù) 部分,多種分類指定為文章。
In this example, the special character entity, the heart (♥) symbol, separates the categories of WordPress, Computers, and Internet News:
<?php the_category(' ♥ ') ?>
在這個例子中,特殊的文字實體心形(♥)符號把WordPress, 電腦和網(wǎng)絡(luò)新聞 分類分開來:
<?php the_category(' ♥ ') ?>
In this example you see the use of an accent in your post's title:
<?php the_title('∞ ', ' ∞'); ?>
這個離子中你可以看到文章標(biāo)題中使用的其中一種符號:
<?php the_title('∞ ', ' ∞'); ?>
If you want to highlight the post's author, you don't have to use a character entity inside of a WordPress template tag. You can use it in the text.
<div id="author">♦ <?php the_author(); ?></div>
如果你想要把文章作者高亮顯示,你不用在WordPress模板標(biāo)簽中使用文字實體,你可以使用以下代碼:
<div id="author">♦ <?php the_author(); ?></div>
As you have seen, there are a many uses for character entities within your site. With this information you can experiment and find creative ways to use these symbols in your design!
- Note: Not all template tags can use character entities, especially those tags that use boolean parameters. Test a template tag thoroughly to be sure that it will accept the symbols.
如同你所看到的,在你的站點中有很多文字實體的使用。你可以實驗,然后找到更多創(chuàng)造性的方法來使用這些符號做好你的設(shè)計!
- 注意:不是所有的模板標(biāo)簽可以使用文字實體,尤其是那些使用布爾參數(shù)的標(biāo)簽。測試一個模板標(biāo)簽 thoroughly,確認(rèn)它可以接受這種符號。
Character Entities Resources
- ASCII HTML Codes
- Microsoft Developer’s HTML Character Sets
- Digital Web Magazine’s Extended ASCII Characters for HTML
- University of Texas - Special and Extended Characters
- Browser Support for Extended Characters
- Chami’s Tips: HTML Special Character Reference
- The Unicode Consortium site