编辑“WordPress:Fun Character Entities

跳转至: 导航、​ 搜索
警告:您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您登录创建一个账户,您的编辑将归属于您的用户名,且将享受其他好处。

该编辑可以被撤销。 请检查下面的对比以核实您想要撤销的内容,然后发布下面的更改以完成撤销。

最后版本 您的文本
第1行: 第1行:
=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:
<div style="border:1px solid blue; width:50%; margin:20px; padding:20px">[[WordPress:#Character Entities or Extended Characters|&laquo; &laquo; Previous Post Title]]&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;[[WordPress:#Character Entities or Extended Characters|Next Post Title &raquo; &raquo; ]]</div>
These symbols are called '''[[WordPress:Glossary#HTML|HTML]] character entities''' or '''extended characters'''.  They are generated by strange looking code on the web page that the web browser interprets as symbols. 
=文字实体或者扩展文字=
=文字实体或者扩展文字=
在许多WordPress站点上,你可以看到单个的符号有时突然出现。通常这些符号出现在导航连接上。举个例子,看这个例子中的书名号'''(&laquo;)'''和'''(&raquo;)''':
在许多WordPress站点上,你可以看到单个的符号有时突然出现。通常这些符号出现在导航连接上。举个例子,看这个例子中的书名号'''(&laquo;)'''和'''(&raquo;)''':


<div style="border:1px solid blue; width:50%; margin:20px; padding:20px">[[#WordPress:Character Entities or Extended Characters|&laquo; &laquo; Previous Post Title]]&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;[[#WordPress:Character Entities or Extended Characters|Next Post Title &raquo; &raquo; ]]</div>
<div style="border:1px solid blue; width:50%; margin:20px; padding:20px">[[WordPress:#Character Entities or Extended Characters|&laquo; &laquo; Previous Post Title]]&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;[[WordPress:#Character Entities or Extended Characters|Next Post Title &raquo; &raquo; ]]</div>


这些符号叫做'''[[WordPress:Glossary#HTML|HTML]] 文字实体'''或者叫做'''扩展文字'''.它们是通过一些网页上看起来很奇怪的,浏览器认为是符号的代码生成的。  
这些符号叫做'''[[WordPress:Glossary#HTML|HTML]] 文字实体'''或者叫做'''扩展文字'''.它们是通过一些网页上看起来很奇怪的,浏览器认为是符号的代码生成的。  
The code that generated the above example looks like this:
<pre><?php previous_post('&amp;laquo; &amp;laquo; %', '', 'yes'); ?>
| <?php next_post('% &amp;raquo; &amp;raquo; ', '', 'yes'); ?></pre>


生成上述例子的代码如下:
生成上述例子的代码如下:
<pre><?php previous_post('&amp;laquo; &amp;laquo; %', '', 'yes'); ?>
<pre><?php previous_post('&amp;laquo; &amp;laquo; %', '', 'yes'); ?>
| <?php next_post('% &amp;raquo; &amp;raquo; ', '', 'yes'); ?></pre>
| <?php next_post('% &amp;raquo; &amp;raquo; ', '', 'yes'); ?></pre>
Some of the most popular [[WordPress:Glossary#HTML|HTML]] ''character entities'' are:


一些最流行的[[WordPress:Glossary#HTML|HTML]] ''文字实体''为:
一些最流行的[[WordPress:Glossary#HTML|HTML]] ''文字实体''为:
第25行: 第38行:
:<tt>&amp;mdash;</tt>&nbsp;&nbsp;&nbsp;&nbsp;&mdash; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;long dash<br />
:<tt>&amp;mdash;</tt>&nbsp;&nbsp;&nbsp;&nbsp;&mdash; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;long dash<br />
</div>
</div>
=Using Character Entities in WordPress=
Using ''character entities'' can be a fun part of your design!  You can use these special accents with [[WordPress:Template Tags|template tags]] such as the [[WordPress:Template Tags/the_category|<tt>the_category()</tt>]] tag.  Note:  [[WordPress:Template Tags/the_category|<tt>the_category()</tt>]] [[WordPress:Template Tags|template tag]] lists, in [[WordPress:Post Meta Data Section|''post meta data'']] section, the various [[WordPress:Glossary#Category|categories]] assigned to a [[WordPress:Glossary#Post|post]].


=在WordPress中使用文字实体=
=在WordPress中使用文字实体=
使用''文字实体''是设计中一个有趣的部分!你可以在[[WordPress:Template Tags|模板标签]]中使用这些特殊符号,如[[WordPress:Template Tags/the_category|<tt>the_category()</tt>]]标签。注意:[[WordPress:Template Tags/the_category|<tt>the_category()</tt>]] [[WordPress:Template Tags|模板标签]]列表,在[[WordPress:Post Meta Data Section|''文章meta数据'']] 部分,多种[[WordPress:Glossary#Category|分类]]指定为[[WordPress:Glossary#Post|文章]]。
使用''文字实体''是设计中一个有趣的部分!你可以在[[WordPress:Template Tags|模板标签]]中使用这些特殊符号,如[[WordPress:Template Tags/the_category|<tt>the_category()</tt>]]标签。注意:[[WordPress:Template Tags/the_category|<tt>the_category()</tt>]] [[WordPress:Template Tags|模板标签]]列表,在[[WordPress:Post Meta Data Section|''文章meta数据'']] 部分,多种[[WordPress:Glossary#Category|分类]]指定为[[WordPress:Glossary#Post|文章]]。


In this example, the special ''character entity'', the heart ('''&hearts;''') symbol, separates the  [[WordPress:Glossary#Category|categories]] of WordPress, Computers, and Internet News:
<pre><?php the_category(' &amp;hearts; ') ?></pre>
<div style="font-size: 105%; color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">WordPress &hearts; Computers &hearts; Internet News</div>


在这个例子中,特殊的''文字实体''心形('''&hearts;''')符号把WordPress, 电脑和网络新闻 [[WordPress:Glossary#Category|分类]]分开来:
在这个例子中,特殊的''文字实体''心形('''&hearts;''')符号把WordPress, 电脑和网络新闻 [[WordPress:Glossary#Category|分类]]分开来:
第36行: 第57行:
<div style="font-size: 105%; color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">WordPress &hearts; Computers &hearts; Internet News</div>
<div style="font-size: 105%; color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">WordPress &hearts; Computers &hearts; Internet News</div>


这个例子中你可以看到[[WordPress:Template Tags/the_title|文章标题]]中使用的其中一种符号:
In this example you see the use of an accent in your [[WordPress:Template Tags/the_title|post's title]]:


<pre><?php the_title('&amp;#8734; ', ' &amp;#8734;'); ?> </pre>
<pre><?php the_title('&amp;#8734; ', ' &amp;#8734;'); ?> </pre>


<div style="font-size: 120%; color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">&#8734; WordPress Makes Me Smile &#8734;</div>
<div style="font-size: 120%; color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">&#8734; WordPress Makes Me Smile &#8734;</div>
这个离子中你可以看到[[WordPress:Template Tags/the_title|文章标题]]中使用的其中一种符号:
<pre><?php the_title('&amp;#8734; ', ' &amp;#8734;'); ?> </pre>
<div style="font-size: 120%; color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">&#8734; WordPress Makes Me Smile &#8734;</div>
If you want to highlight the [[WordPress:Template Tags/the_author|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.
<pre><div id="author">&amp;diams; <?php the_author(); ?></div></pre>
<div style="color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">&diams; Harriet Smith</div>


如果你想要把[[WordPress:Template Tags/the_author|文章作者]]高亮显示,你不用在WordPress模板标签中使用文字实体,你可以使用以下代码:
如果你想要把[[WordPress:Template Tags/the_author|文章作者]]高亮显示,你不用在WordPress模板标签中使用文字实体,你可以使用以下代码:
第47行: 第80行:


<div style="color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">&diams; Harriet Smith</div>
<div style="color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">&diams; Harriet Smith</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 [[WordPress:Template_Tags|template tags]] can use ''character entities'', especially those [[WordPress:Template_Tags|tags]] that use [[WordPress:Template_Tags/How_to_Pass_Tag_Parameters#Boolean|boolean parameters]]. Test a [[WordPress:Template_Tags|template tag]] '''thoroughly''' to be sure that it will accept the symbols.


如同你所看到的,在你的站点中有很多''文字实体''的使用。你可以实验,然后找到更多创造性的方法来使用这些符号做好你的设计!
如同你所看到的,在你的站点中有很多''文字实体''的使用。你可以实验,然后找到更多创造性的方法来使用这些符号做好你的设计!


::'''注意:'''不是所有的[[WordPress:Template_Tags|模板标签]]可以使用''文字实体'',尤其是那些使用[[WordPress:Template_Tags/How_to_Pass_Tag_Parameters#Boolean|布尔参数]]的[[WordPress:Template_Tags|标签]]。测试一个[[WordPress:Template_Tags|模板标签]] '''thoroughly''',确认它可以接受这种符号。
::'''注意:'''不是所有的[[WordPress:Template_Tags|模板标签]]可以使用''文字实体'',尤其是那些使用[[WordPress:Template_Tags/How_to_Pass_Tag_Parameters#Boolean|布尔参数]]的[[WordPress:Template_Tags|标签]]。测试一个[[WordPress:Template_Tags|模板标签]] '''thoroughly''',确认它可以接受这种符号。
==Character Entities Resources==
* [http://www.ascii.cl/htmlcodes.htm ASCII HTML Codes]
* [http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/charsets/charsets.asp Microsoft Developer&#8217;s HTML Character Sets]
* [http://www.digital-web.com/articles/extended_ascii_characters_for_html/ Digital Web Magazine&#8217;s Extended ASCII Characters for HTML]
* [http://www.utexas.edu/learn/html/spchar.html University of Texas - Special and Extended Characters]
* [http://www.fjordaan.uklinux.net/moveabletype/fblog/archives/000063.html Browser Support for Extended Characters]
* [http://www.chami.com/tips/internet/050798I.html Chami&#8217;s Tips: HTML Special Character Reference]
* [http://unicode.org/ The Unicode Consortium site]


==文字实体资源==
==文字实体资源==
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅Wordpress-mediawiki:版权的细节)。 未经许可,请勿提交受版权保护的作品!
取消 编辑帮助(在新窗口中打开)