[WordPress] 外掛分享: Index Pages

首頁外掛目錄 › Index Pages
60+
安裝啟用
尚無評分
520 天前
最後更新
問題解決
WordPress 4.0.0+ PHP 5.4.0+ v1.3.0.1 上架:2016-02-02

內容簡介

Index Pages 系統允許您指定某些頁面作為特定文章類型的索引頁面。

這樣,如果您當前使用的佈景主題支援,您可以自定義標題、文本內容和其他信息,
在文章類型的存檔頁面上顯示它們。

對於佈景主題開發人員,該插件提供了一些模板函數,可加載當前索引頁面(包括文章頁面)的
文章對象,類似於 the_post();,從而創建諸如可自定義的介紹橫幅之類的東西,它出現在列表上面,
使用索引頁面的數據。

指定索引頁面在頁面管理員中標記為此,以便易於識別。

使用文檔

索引頁面分配界面可以在“設置”>“閱讀”下找到。默認情況下,所有註冊了 has_archive 參數設置為 true
的文章類型都可以進行分配。

對於主題和插件開發人員,您可以註冊支持您的自定義文章類型,如下所示:

IndexPages\Registry::add_post_types( $post_types ); // 一個或多個文章類型的數組

當分配索引頁面時,它的永久鏈接將指向相關文章類型的存檔,並相應地更新頁面標題。

對於主題和插件開發人員,您可以使用以下方法訪問索引頁面的文章對象。

the_index_page();

這與 the_post(); 完全相同,使用索引頁面的數據填充 $post 變量。

外掛標籤

開發者團隊

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

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

原文外掛簡介

The Index Pages system allows you to designate pages as the index page for a particular post type.
This allows you to have a custom title, text content, and other information displayed on your
post type archives, should your current theme support it.
For theme developers, the plugin offers some template functions for loading the post object for the
current index page (including the posts page), in a similar fashion to the_post();, to create things
like a customizable introductory banner that appears above the listing, using the index page’s data.
Designated index pages are flagged as such in the Pages manager, for easy recognition.
Usage Documentation
The Index Page assignment interface can be found under Settings > Reading. By default, all post types
registered with the has_archive argument set to true will be available for assignment.
For theme and plugin developers, you can register support for your custom post types like so:
IndexPages\Registry::add_post_types( $post_types ); // a single post type or array of post types

When an index page is assigned, it’s permalink will point to the associated post type’s archive, with
the page title updated appropriately.
For theme and plugin developers, you can access the index page’s post object with the following.
the_index_page();

This works exactly like the_post();, populating the $post variable with the index page’s data.

文章
Filter
Apply Filters
Mastodon