Title: Custom HTML/PHP Post Templates
Author: Stephen AfamO
Published: <strong>2016 年 12 月 22 日</strong>
Last modified: 2017 年 7 月 9 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/html-php-pages-and-posts.svg)

# Custom HTML/PHP Post Templates

 作者：[Stephen AfamO](https://profiles.wordpress.org/stephenafamo/)

[下载](https://downloads.wordpress.org/plugin/html-php-pages-and-posts.2.0.0.zip)

 * [详情](https://cn.wordpress.org/plugins/html-php-pages-and-posts/#description)
 * [评价](https://cn.wordpress.org/plugins/html-php-pages-and-posts/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/html-php-pages-and-posts/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/html-php-pages-and-posts/#developers)

 [支持](https://wordpress.org/support/plugin/html-php-pages-and-posts/)

## 描述

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.

## 评价

![](https://secure.gravatar.com/avatar/dd6b1b16bed8b4cfb74969006f1f6b496b6c9d3ef4f018eea261de6a11ab28ba?
s=60&d=retro&r=g)

### 󠀁[just save my life](https://wordpress.org/support/topic/just-save-my-life/)󠁿

 [aladinDr](https://profiles.wordpress.org/aladin007463/) 2017 年 9 月 19 日 1 回复

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

![](https://secure.gravatar.com/avatar/924ae5210edf116347cd57c370a6bc968a3df28ba6710f3636cd4442859a5af8?
s=60&d=retro&r=g)

### 󠀁[Works like a charm](https://wordpress.org/support/topic/works-like-a-charm-930/)󠁿

 [Stephen AfamO](https://profiles.wordpress.org/stephenafamo/) 2017 年 1 月 19 日

I use this on a couple sites I own and it works wonderfully. I hope you can find
it useful.

 [ 阅读所有2条评价 ](https://wordpress.org/support/plugin/html-php-pages-and-posts/reviews/)

## 贡献者及开发者

「Custom HTML/PHP Post Templates」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Stephen AfamO ](https://profiles.wordpress.org/stephenafamo/)

[帮助将「Custom HTML/PHP Post Templates」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/html-php-pages-and-posts)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/html-php-pages-and-posts/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/html-php-pages-and-posts/)，或通过
[RSS](https://plugins.trac.wordpress.org/log/html-php-pages-and-posts/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/html-php-pages-and-posts/)。

## 更新日志

#### 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

## 额外信息

 *  版本 **2.0.0**
 *  最后更新：**9 年前**
 *  活跃安装数量 **60+**
 *  WordPress 版本 ** 3.0.1 或更高版本 **
 *  已测试的最高版本为 **4.8.28**
 *  语言
 * [English (US)](https://wordpress.org/plugins/html-php-pages-and-posts/)
 * 标签
 * [custom pages](https://cn.wordpress.org/plugins/tags/custom-pages/)[custom posts](https://cn.wordpress.org/plugins/tags/custom-posts/)
   [custom templates](https://cn.wordpress.org/plugins/tags/custom-templates/)[html](https://cn.wordpress.org/plugins/tags/html/)
   [php](https://cn.wordpress.org/plugins/tags/php/)
 *  [高级视图](https://cn.wordpress.org/plugins/html-php-pages-and-posts/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  2 条 5 星评价     ](https://wordpress.org/support/plugin/html-php-pages-and-posts/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/html-php-pages-and-posts/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/html-php-pages-and-posts/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/html-php-pages-and-posts/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/html-php-pages-and-posts/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/html-php-pages-and-posts/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/html-php-pages-and-posts/reviews/)

## 贡献者

 *   [ Stephen AfamO ](https://profiles.wordpress.org/stephenafamo/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/html-php-pages-and-posts/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](http://stephenafamo.com)