[WordPress] 外掛分享: Custom HTML/PHP Post Templates

首頁外掛目錄 › Custom HTML/PHP Post Templates
60+
安裝啟用
★★★★★
5/5 分(2 則評價)
3174 天前
最後更新
問題解決
WordPress 3.0.1+ v2.0.0 上架:2016-12-21

內容簡介

這個外掛讓你可以使用任何 HTML 或 PHP 檔案作為任何頁面或文章的模板。

只需要上傳檔案並選擇它即可。
你可以將自定義的 js 和 css 檔案上傳到媒體庫並從 HTML 檔案中鏈結到它們。

選項:

覆寫全部:你可以覆寫整個主題並使用你的自訂檔案
覆寫內容:保留標題、頁腳、側邊欄等,只單純覆寫頁面或文章的內容部分
在內容上方:你的自訂內容會被放置在頁面內容的頂部
在內容下方:你的自訂內容會被放置在頁面內容的底部

新增自訂文章類型的支援

預設情況下,這個外掛可以處理頁面和文章,但你可以到設定中啟用它並支援任何其他已註冊的文章類型。

使用 hppp_post_types 過濾器添加更多文章類型。

像這樣:

public function post_type_modify ($post_types) {
$post_types[] = 'custom_post_type';
return $post_types;
}

add_filter( 'hppp_post_types', 'post_type_modify' );

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.0.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Custom HTML/PHP Post Templates」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

This plugin allows you to use any HTML or PHP file as the template for any page or post.
Simply upload the file and select it.
You can upload custom js and css files into the media library and link to them from the HTML file.
Options:

Overwrite All: You overwrite the entire theme and use your custom file
Overwrite Content: Keeps the header, footer, sidebar, e.t.c. Simply overwrites the body of the page or post
Above Content: Your custom content is simply added to the top of the page content
Below Content: You custom content is placed just beneath the page content.

Adding support for custom post types
By default the pulugin works with pages and posts, however, go to the settings to enable it on any other registered post type.
use the hppp_post_types filter to add more post types.
Like this:
public function post_type_modify ($post_types) {
$post_types[] = 'custom_post_type';
return $post_types;
}

add_filter( 'hppp_post_types', 'post_type_modify' );

延伸相關外掛

文章
Filter
Apply Filters
Mastodon