WIKI使用導(dǎo)航
站長(zhǎng)百科導(dǎo)航
站長(zhǎng)專題
- 網(wǎng)站推廣
- 網(wǎng)站程序
- 網(wǎng)站賺錢
- 虛擬主機(jī)
- cPanel
- 網(wǎng)址導(dǎo)航專題
- 云計(jì)算
- 微博營(yíng)銷
- 虛擬主機(jī)管理系統(tǒng)
- 開放平臺(tái)
- WIKI程序與應(yīng)用
- 美國(guó)十大主機(jī)
WordPress:Separating Categories
Your posts are filed in different categories. Category information is freqently displayed in the post meta data section near your post or under the heading title. Different WordPress Themes highlight the post meta data section in different areas.
你的文章是用不同分類存檔的。分類信息通常顯示在文章附近的文章 meta 數(shù)據(jù)部分或者是在頭部標(biāo)題下面。不同的WordPress 主題會(huì)在不同的區(qū)域高亮顯示文章meta信息部分。
The display of the post categories is generated through the use of the the_category() template tag. And you have the ability to style how these categories are displayed.
文章分類的顯示是通過the_category()模板標(biāo)簽的使用來生成的。你可以設(shè)計(jì)這些分類如何顯示。
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.
找出分類標(biāo)簽
你的分類標(biāo)簽可能放在首頁(yè)面,也可能放在一個(gè)或多個(gè)單獨(dú)文章頁(yè)面的不同地方,這樣你可能不得不費(fèi)點(diǎn)力氣來尋找你不同的分類標(biāo)簽了。你可能還想設(shè)計(jì)一個(gè)與眾不同的標(biāo)簽,但首先要把它們找出來。
The post meta data featuring your categories tag in your Theme is usually found on the index.php, single.php, or sometimes in the sidebar.php template files. Open one or more of these template files and search for:
<?php the_category() ?>
在整個(gè)主題中,帶有你的分類標(biāo)簽的文章 meta 數(shù)據(jù),通常可以在index.php, single.php,或者有時(shí)在sidebar.php 模板文件中可以找到。打開一個(gè)或者多個(gè)模板文件并搜索:
<?php the_category() ?>
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.
一旦找到之后,再看看網(wǎng)頁(yè),然后決定如何更改這些信息。
The the_category() template tag instructs the database to get the information regarding the post categories and display it at that point in your 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.
the_category()模板標(biāo)簽指導(dǎo)數(shù)據(jù)庫(kù)獲得關(guān)于文章分類的信息,并且在模板文件中顯示出來。默認(rèn)情況下,它顯示分類的列表,每?jī)蓚€(gè)分類中間有空格隔開。你可以通過添加標(biāo)簽內(nèi)部的參數(shù)更改它們。讓我們通過分類名:WordPress, Computers, and Internet News,從簡(jiǎn)單的分隔器開始。
Simple Separators
If you would like to have commas between the categories, the tag should read:
<?php the_category(',') ?>
簡(jiǎn)單的分隔器
如果你想在分類中間加上逗號(hào),標(biāo)簽內(nèi)容如下:
<?php the_category(',') ?>
And it would look like this:
顯示結(jié)果如下:
If you would like to have an arrow, the tag would look like this:
<?php the_category(' > ') ?>
如果你還想要有一個(gè)箭頭,標(biāo)簽內(nèi)容如下
<?php the_category(' > ') ?>
If you would like to have a bullet, the tag would look like this:
<?php the_category(' • ') ?>
如果你想有一個(gè)bullet符號(hào),標(biāo)簽內(nèi)容如下:
<?php the_category(' • ') ?>
If you would like the "pipe" ( | ) between the categories, the tag would look like this:
<?php the_category(' | ') ?>
如果你想要在分類中間加入"pipe" ( | )符號(hào),這個(gè)標(biāo)簽內(nèi)容如下:
<?php the_category(' | ') ?>
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:
<p>You can read related subjects in the <?php the_category(' and ') ?> categories.</p>
向分類中添加文本
你想讓你的文章meta數(shù)據(jù)看起來更象文字,非正式并且象是一段文章而不是列表嗎?你可以在分類中間加入"and",如下:
<p>You can read related subjects in the <?php the_category(' and ') ?> categories.</p>
Or you can give them more of a choice and change the "and" to an "or":
或者你可以給它們更多的選擇,把"and" 改成"or":
The possibilities are endless. Have fun and use your imagination! 可能性是無限的。運(yùn)用你的想象力,玩的開心!