Tags 變成數字

最近在新安裝的WordPress執行匯入 WordPress時,發生了一個狀況,就是匯入完成後,原來文章的Tags都變成了數字(圖一紅色框框),檢查上傳的xml檔案裡面的Tags也是正常的文字呈現,因此推斷應該是在上傳的過程發生問題。

Tags變成數字
(圖一)


在WordPress trac找到Ticket #5330 wxr import inserts tags with numbers instead of names有相關的說明,也提供了相關的修正說明

解決的方法說明如下:

1. 打開/wp-admin/import/wordpress.php檔案。
2. 找到399行,將$post_tags[] = $tag_id;修改成$post_tags[] = intval($tag_id);
3. 以上完成,再重新匯入WordPress,應該就可以正常呈現Tags了(圖二)。

Tags變成數字
(圖二)


(註)這次作業的版本是WordPress 2.3.3版。

This entry was posted in Troubleshooting, 網誌 and tagged , , . Bookmark the permalink.

One Response to Tags 變成數字

  1. 謝謝這麼詳盡的教學唷
    雖然還沒遇到這樣的問題
    但是很感謝您可以寫的如此詳細唷

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">