[WP] Tag Your WordPress

之前看到 QQ 裝了 Jerome’s Keywords Plugin,感覺滿有用的,研究一下把它裝上了。

keywords tags

安裝方法很簡單,只要將解壓縮後的檔案放入 wp-content/plugins 資料夾裡,於外掛管理介面啟用後,便可以看到在發表文章的下方出現 Keywords 的輸入欄,如左圖。

要讓這些 Keywords/Tags 顯示在文章上,必須修改 Theme 之下的 index.php 以及 single.php,使用 <?php the_post_keytags(); ?> 來呼叫,需注意的是 <?php the_post_keytags(); ?> 必須加在 loop 之間。

再以 <?php the_post_keytags(); ?> 為例,可以加入 include_cats、local_search、linktitle 三種不同的控制參數,預設分別為: false (文章分類不列入 Tags 之中)、'tag' (Tags 的連結導向本地端)、'Search site for ' (滑鼠移至連結上時顯示 Search site for )

作者 Jerome 舉了例子:

example 1.

<?php the_post_keytags(true); ?>

文章分類列入 Tags 之中;

example 2.

<?php the_post_keytags(false, 'technorati'); ?>

文章分類不列入 Tags 之中、Tags 的連結導向 Technorati;

example 3.

<?php the_post_keytags(true, 'tag', 'View all posts on geewhiz.com for '); ?>

文章分類列入 Tags 之中、Tags 的連結導向本地端、滑鼠移至連結上時顯示 View all posts on geewhiz.com for 你的 Tag;

如果不需改變,則直接使用 <?php the_post_keytags(); ?> 即可。

最後,如果有使用 permalink,記得至後台重新更新一次狀態,或是手動 (個人建議) 將以下 code 加入你的 .htaccess:

RewriteRule ^tag/(.+)/feed/(feed|RDF|RSS|rss2|atom)/?$ /index.php?tag=$1&feed=$2 [QSA,L]
RewriteRule ^tag/(.+)/(feed|RDF|RSS|rss2|atom)/?$ /index.php?tag=$1&feed=$2 [QSA,L]
RewriteRule ^tag/(.+)/page/?([0-9]{1,})/?$ /index.php?tag=$1&paged=$2 [QSA,L]
RewriteRule ^tag/(.+)/?$ /index.php?tag=$1 [QSA,L]

至於俏麗的 Tag Cosmos 的功能,我想用 Static Page 的方式來呈現,可是出現了一點錯誤,只好先擱一旁。 使用作者提供的檔案,將 cosmos.php 放入 theme 的資料夾下,再新增一個 page ,template 選擇 cosmos 使用即可!

Bookmark to del.icio.usBookmark to furlBookmark to Blinklist

12 Responses to “[WP] Tag Your WordPress”


  1. […] shuffle Tags for WP 終於裝好囉 Tags 的功能 參考資料: hsuyo的文章 Jerome’s Keywords Plugin 本文章發表 於 Tu […]

  2. 請問這至於俏麗的 Tag Cosmos 的功能是如何設定,我看原作者的網站,還是做不起來,你可以教教我嗎?謝謝

  3. 下載了檔案之後,把 cosmos.php 放在 theme 的資料夾下,然後新增一個 page ,template 選擇 cosmos 使用即可! 試試看吧!

  4. 謝謝,但,我照你的方式做,點選tag之後卻出現:Not Found
    The requested URL /tag/哲學+網路 was not found on this server

  5. 耶? 你有更新 .htaccess 嗎?

  6. .htaccess是什麼?它在那裡?謝謝

  7. 要使用 Tag Cosmos,必須先啟用 permalinks (友善連結),你可以在控制後台的 Options > Permalinks 找到這個功能。透過設定 .htaccess 將網址格式中的問號與數字轉為你所設定的格式。

    如果 .htaccess 檔案不存在,則新增一個文字檔,將 wordpress 產生的 code 貼入,存檔為 temp.htaccess,上傳到 blog 的根目錄中,再更名把 temp 去掉成為 .htaccess 。

  8. 將 wordpress 產生的 code 貼入
    這句話是什麼意思,不好意思,不懂!!!

  9. 如果 .htaccess 不可寫入,在 Options > Permalinks 的下方,就會自動產生幾串 code,讓你自己建立 .htaccess

    建議閱讀 WordPress Codex 可得更多資訊。

  10. […] http://blog.hsuyo.info/2005/0429/282/ […]

  11. […] http://blog.hsuyo.info/2005/0429/282/ […]

  12. 酷 ! WordPress Tag - Jerome’s Keywords Plugin…

    早就想裝這種東西 , 只是一直無法成功 , 因為英文不好看無曉得 , 加上對所謂的 Permalink 這個東東沒概念 , 所以總是無疾而終 , 今天看了 hsuyo BLOG » Blog Archive » [WP] Tag Your WordPress 這篇 , 興…..


Got something to say?



Related Posts from the Past: