內容簡介
Custom Post Archives 這個外掛,連結了在 WordPress 3 中建立自訂文章類型和實際顯示這些文章的差距。透過這個外掛,你可以選擇為每個文章類型建立一個完全不同於博客的區域,其中包含你期望在 WordPress 中看到的所有功能。
對於每個自訂文章類型,如果你點擊「啟用」並輸入一個專屬的 slug 名,這個外掛就會讓你顯示文章類型專屬的:
檔案庫
日期檔案庫
作者檔案庫
類別檔案庫
RSS feeds
這個外掛同時提供了許多其他功能,完全整合你的自訂文章類型,其中包括:
為建立在 WordPress 3 中所建立的新選單區段新增一個選單選項(適用於支援的主題)
結合檔案庫(http://www.mysite.com/type1+type2/)
將文章類型新增至預設部落格
將文章類型新增至預設 RSS feed
新增文章類型支援到 wp_get_archives 函數
新增多個全域函數和過濾器以處理自訂文章類型(詳情請查閱功能和過濾器或外掛幫助)
在自訂分類目錄檔案庫上自動顯示相關的文章類型
擴展 WordPress 模板,允許主題作者進行彈性調整(詳情請查閱常見問題或外掛幫助)
在做出修改後自動清除重寫緩存
在建立的檔案庫頁面的本體類別中自動添加「blog-{post_type}」類別(對實作 body_class 函數的主題適用)
如需幫助和支援,外掛頁面的內容幫助部分提供了幫助;如果這還不夠,請務必查看常見問題和外掛論壇。
如果你有任何其他功能需要,我非常樂意聽取你的建議。請隨時發送消息或訪問論壇!
功能和過濾器
這個外掛建立了以下功能和過濾器。如需更詳細的說明,請查閱設定頁面內建的幫助部分。
功能
is_custom_archive({$post_type = false});
get_custom_archive_url($post_type);
get_custom_archive_label({$post_type = false});
get_custom_archive_link($post_type);
以下功能為進階用戶使用。每個功能會覆蓋外掛設置中相應文章類型的設置。
add_custom_archive($post_type,$slug,{$in_default = false,$in_rss = false});
remove_custom_archive($post_type);
add_to_default_archive($post_type);
remove_from_default_archive($post_type);
reset_custom_archive_to_default($post_type);
過濾器
cpa_rewrite_label
透過這個過濾器,你可以格式化 get_custom_archive_label() 返回的標籤。
cpa_templates
透過這個過濾器,你可以提供或更改 Custom Post Archives 搜索的模板列表。
外掛標籤
開發者團隊
原文外掛簡介
Custom Post Archives bridges the gap between creating Custom Post Types in WordPress 3, and actually displaying those posts. With this plugin, you have
the option of displaying a completely seperate blog-like section for each post type, complete with all the features you expect to see with WordPress.
For each custom post type, if you click “active” and enter a slug-name, this plugin will let you display post-type specific:
Archives
Date archives
Author archives
Category archives
RSS Feeds
This plug-in also provides many additional features to fully integrate your custom post types, including:
Adds a menu option to the new menu section created in WordPress 3 (for themes that support it)
Combined archives (http://www.mysite.com/type1+type2/)
Option to add post types to default blog
Option to add post types to default RSS feed
Adds post type support to wp_get_archives function
Adds multiple global functions and filters for working with custom post types (see Functions and Filters or Plugin Help for details)
Automatically displays the associated post type on custom taxonomy archives
Extends upon the WordPress templating, allowing for flexibility by theme authors (see FAQ or Plugin Help for details)
Automatically flushes the rewrite cache after modifications are detected
Automatically adds a “blog-{post_type}” type class to the body of the created archives (for themes that implement body_class())
For help and support, help has been built into the plug-in page’s contextual help section; be sure to check the FAQ and the plug-in forums if that doesn’t do it.
If there are any other features you’d like to see, I’m all ears. Feel free to send a message, or hit the forums!
Functions and Filters
The following function and filters are created by this plug-in. For more detailed descriptions, check the Help section built into the settings page.
Functions
is_custom_archive({$post_type = false});
get_custom_archive_url($post_type);
get_custom_archive_label({$post_type = false});
get_custom_archive_link($post_type);
The following functions are for advanced users. Each overrides the settings for the corresponding post_type in the plugin settings.
add_custom_archive($post_type,$slug,{$in_default = false,$in_rss = false});
remove_custom_archive($post_type);
add_to_default_archive($post_type);
remove_from_default_archive($post_type);
reset_custom_archive_to_default($post_type);
Filters
cpa_rewrite_label
Allows you to format the label returned by get_custom_archive_label().
cpa_templates
Allows you to provide or alter the list of templates Custom Post Archives searches for.
