[WordPress] 外掛分享: WP Permastructure

首頁外掛目錄 › WP Permastructure
400+
安裝啟用
★★★★
4.3/5 分(15 則評價)
966 天前
最後更新
問題解決
WordPress 3.3+ v1.4.4 上架:2012-09-02

內容簡介

此外,除了控制自訂文章類型的永久網址,此外掛還支援在您的永久網址結構中使用自訂分類。

不僅如此,您還可以控制完整的永久網址,使文章類型別名不需要出現在連結開頭。

多個文章類型可以使用相同的永久網址結構。

使用方式

此外掛有兩種使用方式:

永久網址設定

此外掛會為任何公開的自訂文章類型在永久網址設定頁面新增欄位。

程式碼中使用

當註冊文章類型時,您可以在重寫屬性中使用值來定義您的預設永久網址結構,此鍵為「permastruct」。

例如:

<?php

register_post_type( 'my_type', array(
...
'rewrite' => array(
'permastruct' => '/%custom_taxonomy_name%/%author%/%postname%/'
),
...
) );

?>

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.4.4) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「WP Permastructure」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

In addition to controlling your custom post type permalinks this plugin adds support for using custom taxonomies in your permalink structures as well.
Not only that but you can control the full permalink so the post type slug is not required at the start of the link.
Multiple post types can use the same permalink structure.
Usage
There are 2 ways to use this plugin:
Permalink Settings
The plugin adds fields to the permalinks settings page for any public facing custom post types.
In Code
When registering a post type you can add a value to the rewrite property with the key ‘permastruct’ to define your default permalink structure.
eg:
array(
'permastruct' => '/%custom_taxonomy_name%/%author%/%postname%/'
),
...
) );

?>

延伸相關外掛

文章
Filter
Apply Filters
Mastodon