
內容簡介
如果您在 WordPress 中創建自定義分類法(taxonomy),不論它是主題(theme)還是外掛(plugin)的一部分,當您嘗試在您的網站前端查看此分類法時,可能會遇到 404 錯誤。
這通常只會發生在您在永久連結(permalink)中引用此分類法時,例如,如果您的永久連結看起來像這樣:
/%category%/%postname%/
乍一看這似乎沒有問題,但當您嘗試導航到分類法歸檔的第 2 頁時,這將導致 WordPress 將您導向類似以下 URL 的頁面:
www.your_site.com/your_taxonomy/page/2
最後的 '/page/2' 部分會與此永久連結的設置發生衝突,導致 404 錯誤。
此外掛程式解決這個問題啦 🙂
有關更多信息,請參閱https://www.electriccode.co.uk/blog/fixing-404-errors-with-wordpress-custom-taxonomies/。
使用方法
步驟 1. 安裝外掛程式
步驟 2. 啟用外掛程式
步驟 3. 享受您無錯誤的自訂分類法分頁
外掛標籤
開發者團隊
原文外掛簡介
If you create a custom taxonomy in WordPress, whether it’s part of a theme or a plugin, you may encounter a 404 error when trying to view the taxonomy on the front end of your website.
This normally only happens if you are referencing the taxonomy in your permalinks, i.e. if your permalinks look something like this:
/%category%/%postname%/
At first glance this seems to be fine, until you try to navigate to page 2 of the taxonomy archive. This will result in WordPress sending you to a URL something like this:
www.your_site.com/your_taxonomy/page/2
The ‘/page/2’ bit stuck on the end will clash with your permalink settings, causing in an a 404 error.
This plugin fixes that 🙂
See https://www.electriccode.co.uk/blog/fixing-404-errors-with-wordpress-custom-taxonomies/ for more information.
Usage
Step 1. Install plugin
Step 2. Activate plugin
Step 3. Enjoy your error free custom taxonomy pagination
