前言介紹
- 這款 WordPress 外掛「Rich Taxonomy」是 2021-11-16 上架。
- 目前有 10 個安裝啟用數。
- 上一次更新是 2023-11-15,距離現在已有 536 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 5.9 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 7.0 以上。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
內容簡介
此外掛會創建一個自定義文章類型「Taoxnomy Page」,該類型與一個術語關聯。
如何操作
「分類頁面」將覆蓋術語存檔的第一頁。您可以選擇哪些分類擁有「分類頁面」。
例如:
您已決定「類別」擁有「分類頁面」。
為「Book」類別創建一個「分類頁面」。
以塊狀編輯器編輯「分類頁面」並發布它。
現在「書籍」類別的第 1 頁 /category/book 會顯示「分類頁面」«书页» 的內容。
模板結構
您可以在編輯器中為分類頁面選擇模板,
但是您可以在您的佈景主題中放置 singular-taxonomy-page.php 模板,因此無需進行選擇。
以下是默認模板優先級:
singular-taxonomy-page.php
page.php
singular.php
single.php
index.php
過濾器 hook rich_taxonomy_include_template 也可用。
自定義
存檔區塊
存檔區塊具有以下模板結構。
template-parts
- rich-taxonomy
- archive-block-loop.php // 文章列表循環。
- archive-block-more.php // 鏈接按鈕。
- archive-block-toggle.php // 切換按鈕。
- archive-block-wrapper.php // 存檔的包裝。
如果主題具有相同路徑中的文件,則具有優先權。
複製文件並自定義。
樣式
要覆蓋樣式,有 4 個 hook 可用。
rich_taxonomy_block_asset_style
rich_taxonomy_block_asset_editor_style
rich_taxonomy_block_asset_script
rich_taxonomy_block_asset_editor_script
要更改外觀和感覺,可以從 rich_taxonomy_block_asset_style 開始。
// 註冊樣式。
add_action( 'init', function() {
wp_registeR_style( 'my-archive-block', $url, $deps, $version );
} );
// 覆蓋處理。
add_filter( 'rich_taxonomy_block_asset_style', function( $handle, $block_name ) {
if ( 'rich-taxonomy/arcvhie-block' === $block_name ) {
$handle = 'my-archive-block';
}
return $handle;
}, 10, 2 );
此樣式在公共和編輯器中都會加載。
默認內容
要定義分類頁面的默認內容,請使用 rich_taxonomy_default_post_object 篩選器 hook。
/**
* 篩選默認帖子對象。
*
* @param array $args 通過 wp_insert_post()傳遞的文章對象。
* @param WP_Term $term 指定給此帖子的術語對象。
* @param string $context 目前僅支持 'api'。
*/
add_filter( 'rich_taxonomy_default_post_object', function( $args, $term, $contest ) {
// 如果特定分類,請輸入默認內容。
if ( 'category' === $term->taxonomy ) {
// 帖子內容。
$args['post_content'] = '這裡是默認內容。';
// 立即發佈。
$args['post_status'] = 'publish';
}
return $args;
}, 10, 3 );
原文外掛簡介
This plugin create a custom post type “Taoxnomy Page” which related to a term.
How It Works
Taxonomy Page will override the 1st page of term archive. You can choose which taxonomy to have a Taxonomy Page.
For example:
You have decided “category” to have Taxonomy Page.
Create a Taxonomy Page “Book” for category “Book”.
Edit the Taxonomy Page in block editor and publish it.
Now the 1st page of “Book” category /category/book will dipslay the contents of the Taxonomy Page “Book”.
Template Structure
You can choose a template for the taxonomy page in editor,
but you can put singular-taxonomy-page.php template in your theme and there’s no need to choose.
Below is the default template priority.
singular-taxonomy-page.php
page.php
singular.php
single.php
index.php
Filter hook rich_taxonomy_include_template is also available.
Customization
Archive Block
Archive blocks has tempalte structure like below.
template-parts
- rich-taxonomy
- archive-block-loop.php // Loop of post list.
- archive-block-more.php // Link button.
- archive-block-toggle.php // Toggle button.
- archive-block-wrapper.php // Wrapper of archive.
If the theme has files in the same path, that priors.
Copy the file and customize one as you like.
Styles
To override styles, 4 hooks are available.
rich_taxonomy_block_asset_style
rich_taxonomy_block_asset_editor_style
rich_taxonomy_block_asset_script
rich_taxonomy_block_asset_editor_script
To change looks & feels, rich_taxonomy_block_asset_style is the best starting point.
// Register style.
add_action( 'init', function() {
wp_registeR_style( 'my-archive-block', $url, $deps, $version );
} );
// Override handle.
add_filter( 'rich_taxonomy_block_asset_style', function( $handle, $block_name ) {
if ( 'rich-taxonomy/arcvhie-block' === $block_name ) {
$handle = 'my-archive-block';
}
return $handle;
}, 10, 2 );
This style is loaded in both public and editor.
Default Contents
To define the default contents of the taxonomy page, use rich_taxonomy_default_post_object filter hook.
/**
* Filter default post object.
*
* @param array $args Post object passed to wp_insert_post().
* @param WP_Term $term Term object assigned to this post.
* @param string $context Currently only 'api' is supported.
*/
add_filter( 'rich_taxonomy_default_post_object', function( $args, $term, $contest ) {
// If specific taxonomy, enter default content.
if ( 'category' === $term->taxonomy ) {
// Post body.
$args['post_content'] = 'Here comes default content.';
// Publish immediately.
$args['post_status'] = 'publish';
}
return $args;
}, 10, 3 );
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Rich Taxonomy」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.0.6 | 1.0.7 | 1.0.8 | 1.0.9 | 1.1.0 | 1.1.1 | 1.1.2 | 1.1.4 | 1.1.5 | 1.1.6 | trunk |
延伸相關外掛(你可能也想知道)
Yoast SEO 》Yoast SEO:#1 WordPress SEO 外掛, 自 2008 年以來,Yoast SEO 幫助全球數百萬個網站在搜尋引擎中排名更高。, Yoast 的使命是為所有人提供 SEO 服務。我們的...。
LiteSpeed Cache 》LiteSpeed Cache for WordPress(LSCWP)是一種全方位的網站加速外掛,包括獨家的伺服器層快取和一系列的優化功能。, LSCWP 支援 WordPress Multisite 及大多...。
Rank Math SEO – AI SEO Tools to Dominate SEO Rankings 》Rank Math SEO – WordPress 最佳 SEO 外掛, 第一款使用人工智慧 (AI) 的 WordPress SEO 外掛 🦾, ★★★★★, SEO 是任何網站最穩定的流量來源。我們創建了 Rank M...。
All in One SEO – Powerful SEO Plugin to Boost SEO Rankings & Increase Traffic 》assic Editor, so you don't even need to leave your WordPress dashboard to optimize your content., Here’s what another smart WordPress user ha...。
XML Sitemap Generator for Google 》使用這個外掛程式可以大大改善 SEO,產生特殊的 XML 網站地圖,幫助 Google、Bing、Yahoo 和 Ask.com 等搜索引擎更好地索引您的網站。, 有了這樣的網站地圖,...。
SpeedyCache – Cache, Optimization, Performance 》SpeedyCache 是一款 WordPress 外掛,能透過網頁快取、最小化檔案和檔案壓縮的方式,幫助您減少網站載入時間。, 您可以在 https://speedycache.com/docs 找到...。
SEOPress – On-site SEO 》最佳的 WordPress SEO 外掛程式,與所有網頁建構工具和佈景主題全部整合!, 現在增加了 AI 功能,自動產生 meta 標題和描述!, SEOPress 是一個強大的 WordPr...。
Broken Link Checker by AIOSEO – Easily Fix/Monitor Internal and External links 》總結:Broken Link Checker by AIOSEO 是一款必備的工具,可以確保您的網站上所有的內部和外部連結都能正常運作。快速檢查您的網站中的錯誤鏈接,並輕鬆修復...。
PS Auto Sitemap 》PS Auto Sitemap 是一個 WordPress 外掛,自動從您的 WordPress 網站生成網站地圖頁面。, 對於初學者來說,安裝非常容易;對於專家來說,定制也非常容易。您...。
Cloudflare 》這個外掛可以為您做些什麼, , 自動平台優化 (APO), 使用 Cloudflare 的自動平台優化 (APO) 外掛,可將您的 WordPress 網站加速達 300%。APO 讓 Cloudflare 可...。
The SEO Framework – Fast, Automated, Effortless. 》這是最快速且唯一符合 WordPress 和搜尋引擎規定的 SEO 外掛程式,功能完整。使用經過驗證的方式來優化您的網站的 SEO。這是一款乾淨、專注、可延伸、無限制...。
YARPP – Yet Another Related Posts Plugin 》WordPress 相關文章外掛, Yet Another Related Posts Plugin (YARPP) 是一個經過專業維護、高度自訂和功能豐富的外掛程式,可以顯示與當前文章相關的頁面、文...。
SEO Plugin by Squirrly SEO 》「Squirrly SEO 插件:#1 AI WordPress SEO 外掛程式」HTML描述, , Squirrly SEO 插件: #1 AI WordPress SEO 插件, 解決您的 SEO 挑戰。, Squirrly 的使命是...。
SEO SIMPLE PACK 》“SEO SIMPLE PACK”是一款非常簡單的SEO外掛程式。, , 輸出基本的meta標籤,是SEO措施所必需的。, 可以對每個頁面類型進行設置。, 您也可以設置SN...。
Schema & Structured Data for WP & AMP 》d-data-for-wp.com/docs/article/how-many-schema-types-do-we-support/" rel="nofollow ugc">查看所有支援的類型,目前已支援超過35種類型,其中包括部落格...。