编辑“WordPress:Separating Categories”
该编辑可以被撤销。 请检查下面的对比以核实您想要撤销的内容,然后发布下面的更改以完成撤销。
最后版本 | 您的文本 | ||
第1行: | 第1行: | ||
__TOC__ | __TOC__ | ||
Your posts are filed in different categories. Category information is freqently displayed in the [[WordPress:Post_Meta_Data_Section|post meta data section]] near your post or under the [[WordPress:Designing Headings|heading title]]. Different [[WordPress:Using Themes|WordPress Themes]] highlight the post meta data section in different areas. | |||
你的文章是用不同分类存档的。分类信息通常显示在文章附近的[[WordPress:Post_Meta_Data_Section|文章 meta 数据部分]]或者是在[[WordPress:Designing Headings|头部标题]]下面。不同的[[WordPress:Using Themes|WordPress 主题]]会在不同的区域高亮显示文章meta信息部分。 | 你的文章是用不同分类存档的。分类信息通常显示在文章附近的[[WordPress:Post_Meta_Data_Section|文章 meta 数据部分]]或者是在[[WordPress:Designing Headings|头部标题]]下面。不同的[[WordPress:Using Themes|WordPress 主题]]会在不同的区域高亮显示文章meta信息部分。 | ||
The display of the post categories is generated through the use of the <tt>[[WordPress:Template_Tags/the_category|the_category()]]</tt> template tag. And you have the ability to style how these categories are displayed. | |||
文章分类的显示是通过<tt>[[WordPress:Template_Tags/the_category|the_category()]]</tt>模板标签的使用来生成的。你可以设计这些分类如何显示。 | 文章分类的显示是通过<tt>[[WordPress:Template_Tags/the_category|the_category()]]</tt>模板标签的使用来生成的。你可以设计这些分类如何显示。 | ||
==Finding Your Categories Tag== | |||
The placement of your categories tag may be in one place on the front page and in one or more different places in your single post page, so you may have to do some hunting to find your various categories tags. You might also want to style one differently from the others, but you still have to find them. | |||
==找出分类标签== | ==找出分类标签== | ||
你的分类标签可能放在首页面,也可能放在一个或多个单独文章页面的不同地方,这样你可能不得不费点力气来寻找你不同的分类标签了。你可能还想设计一个与众不同的标签,但首先要把它们找出来。 | 你的分类标签可能放在首页面,也可能放在一个或多个单独文章页面的不同地方,这样你可能不得不费点力气来寻找你不同的分类标签了。你可能还想设计一个与众不同的标签,但首先要把它们找出来。 | ||
The '''post meta data''' featuring your categories tag in your Theme is usually found on the <tt>index.php</tt>, <tt>single.php</tt>, or sometimes in the <tt>sidebar.php</tt> [[WordPress:Templates|template files]]. Open one or more of these template files and search for: | |||
<pre><?php the_category() ?></pre> | |||
在整个主题中,带有你的分类标签的'''文章 meta 数据''',通常可以在<tt>index.php</tt>, <tt>single.php</tt>,或者有时在<tt>sidebar.php</tt> [[WordPress:Templates|模板文件]]中可以找到。打开一个或者多个模板文件并搜索: | 在整个主题中,带有你的分类标签的'''文章 meta 数据''',通常可以在<tt>index.php</tt>, <tt>single.php</tt>,或者有时在<tt>sidebar.php</tt> [[WordPress:Templates|模板文件]]中可以找到。打开一个或者多个模板文件并搜索: | ||
<pre><?php the_category() ?></pre> | <pre><?php the_category() ?></pre> | ||
Once you have found it, take another look at a generated web page of your site and determine how exactly you might want to change this information. | |||
一旦找到之后,再看看网页,然后决定如何更改这些信息。 | 一旦找到之后,再看看网页,然后决定如何更改这些信息。 | ||
The <tt>[[WordPress:Template_Tags/the_category|the_category()]]</tt> template tag instructs the database to get the information regarding the post categories and display it at that point in your [[WordPress:Templates|template file]]. By default, it displays the list of categories with a space between each one. You can change this by adding the parameter inside of the tag. Let's begin with simple separators by playing with the category names: ''WordPress'', ''Computers'', and ''Internet News''. | |||
<tt>[[WordPress:Template_Tags/the_category|the_category()]]</tt>模板标签指导数据库获得关于文章分类的信息,并且在[[WordPress:Templates|模板文件中]]显示出来。默认情况下,它显示分类的列表,每两个分类中间有空格隔开。你可以通过添加标签内部的参数更改它们。让我们通过分类名:''WordPress'', ''Computers'', and ''Internet News'',从简单的分隔器开始。 | <tt>[[WordPress:Template_Tags/the_category|the_category()]]</tt>模板标签指导数据库获得关于文章分类的信息,并且在[[WordPress:Templates|模板文件中]]显示出来。默认情况下,它显示分类的列表,每两个分类中间有空格隔开。你可以通过添加标签内部的参数更改它们。让我们通过分类名:''WordPress'', ''Computers'', and ''Internet News'',从简单的分隔器开始。 | ||
==Simple Separators== | |||
If you would like to have commas between the categories, the tag should read: | |||
<pre><?php the_category(',') ?></pre> | |||
==简单的分隔器== | ==简单的分隔器== | ||
第21行: | 第43行: | ||
<pre><?php the_category(',') ?></pre> | <pre><?php the_category(',') ?></pre> | ||
And it would look like this: | |||
<div style="font-size: 105%; color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">WordPress, Computers, Internet News</div> | |||
显示结果如下: | 显示结果如下: | ||
<div style="font-size: 105%; color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">WordPress, Computers, Internet News</div> | <div style="font-size: 105%; color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">WordPress, Computers, Internet News</div> | ||
If you would like to have an arrow, the tag would look like this: | |||
<pre><?php the_category(' > ') ?></pre> | |||
<div style="font-size: 105%; color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">WordPress > Computers > Internet News</div> | |||
如果你还想要有一个箭头,标签内容如下 | 如果你还想要有一个箭头,标签内容如下 | ||
第31行: | 第63行: | ||
<div style="font-size: 105%; color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">WordPress > Computers > Internet News</div> | <div style="font-size: 105%; color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">WordPress > Computers > Internet News</div> | ||
If you would like to have a [[WordPress:Fun_Character_Entities|bullet]], the tag would look like this: | |||
<pre><?php the_category(' &bull; ') ?></pre> | |||
<div style="font-size: 105%; color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">WordPress • Computers • Internet News</div> | |||
如果你想有一个[[WordPress:Fun_Character_Entities|bullet]]符号,标签内容如下: | 如果你想有一个[[WordPress:Fun_Character_Entities|bullet]]符号,标签内容如下: | ||
第38行: | 第76行: | ||
<div style="font-size: 105%; color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">WordPress • Computers • Internet News</div> | <div style="font-size: 105%; color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">WordPress • Computers • Internet News</div> | ||
If you would like the "pipe" ( | ) between the categories, the tag would look like this: | |||
<pre><?php the_category(' | ') ?></pre> | |||
<div style="font-size: 105%; color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">WordPress | Computers | Internet News</div> | |||
如果你想要在分类中间加入"pipe" ( | )符号,这个标签内容如下: | 如果你想要在分类中间加入"pipe" ( | )符号,这个标签内容如下: | ||
第44行: | 第87行: | ||
<div style="font-size: 105%; color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">WordPress | Computers | Internet News</div> | <div style="font-size: 105%; color: blue; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">WordPress | Computers | Internet News</div> | ||
==Adding Text to Your Categories== | |||
Would you like to make your post meta data look a little more ''textual'', informal and part of a paragraph rather than a list. You can add an '''"and"''' to go between the categories like this: | |||
<pre><p>You can read related subjects in | |||
the <?php the_category(' and ') ?> categories.</p></pre> | |||
<div style="font-size: 105%; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">You can read related subjects in the <span style="color:blue">WordPress</span> and <span style="color:blue">Computers</span> and <span style="color:blue">Internet News</span> categories.</div> | |||
==向分类中添加文本== | ==向分类中添加文本== | ||
第53行: | 第106行: | ||
<div style="font-size: 105%; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">You can read related subjects in the <span style="color:blue">WordPress</span> and <span style="color:blue">Computers</span> and <span style="color:blue">Internet News</span> categories.</div> | <div style="font-size: 105%; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">You can read related subjects in the <span style="color:blue">WordPress</span> and <span style="color:blue">Computers</span> and <span style="color:blue">Internet News</span> categories.</div> | ||
Or you can give them more of a choice and change the '''"and"''' to an '''"or"''': | |||
<div style="font-size: 105%; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">You can read related subjects in the <span style="color:blue">WordPress</span> or <span style="color:blue">Computers</span> or <span style="color:blue">Internet News</span> categories.</div> | |||
或者你可以给它们更多的选择,把'''"and"''' 改成'''"or"''': | 或者你可以给它们更多的选择,把'''"and"''' 改成'''"or"''': | ||
第58行: | 第115行: | ||
<div style="font-size: 105%; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">You can read related subjects in the <span style="color:blue">WordPress</span> or <span style="color:blue">Computers</span> or <span style="color:blue">Internet News</span> categories.</div> | <div style="font-size: 105%; font-weight:bold; margin:20px; padding: 20px; border:solid 1px blue">You can read related subjects in the <span style="color:blue">WordPress</span> or <span style="color:blue">Computers</span> or <span style="color:blue">Internet News</span> categories.</div> | ||
The possibilities are endless. Have fun and use your imagination! | |||
可能性是无限的。运用你的想象力,玩的开心! | 可能性是无限的。运用你的想象力,玩的开心! |