這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

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' );

安裝

  1. Upload html-php-pages-and-posts to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

常見問題

Installation Instructions
  1. Upload html-php-pages-and-posts to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
What about external JS and CSS files?

You can upload it all into the media library. Simply reference them properly in the html file.
e.g. <link rel='stylesheet' href='http://example.com/wp-content/2017/01/my_custom_stylesheet.css' type='text/css' />

Will template tags work in my custom templates?

Yes.
All wordpress functions, and any installed plugin function will work if called properly

What post types will this work with?

By default, it can only be used by on pages and posts, but you can add any other post type by hooking into the hppp_post_types filter.

評價

2017年9月19日 1 reply
with this plugin i added mmore than 17 custom php for one of my clients without scary to fall in 500 error ... just good job guys
閱讀全部2個評價

貢獻者及開發者

“Custom HTML/PHP Post Templates” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

將 Custom HTML/PHP Post Templates 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

修改日誌

2.0.0

  • Add settings page to enable support for any registered post type
  • Allow users to set default template for any registered post type

1.1.0

  • Add filter hook to modify supported post_types

1.0.0

  • First release