Title: Default Theme Pages
Author: Carlos
Published: <strong>2012 年 6 月 18 日</strong>
Last modified: 2012 年 8 月 30 日

---

搜尋外掛

![](https://ps.w.org/default-theme-pages/assets/banner-772x250.png?rev=559748)

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

![](https://s.w.org/plugins/geopattern-icon/default-theme-pages_fbfbfb.svg)

# Default Theme Pages

 由 [Carlos](https://profiles.wordpress.org/carlos_a_sanz/) 開發

[下載](https://downloads.wordpress.org/plugin/default-theme-pages.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/default-theme-pages/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/default-theme-pages/#reviews)
 * [開發資訊](https://tw.wordpress.org/plugins/default-theme-pages/#developers)

 [技術支援](https://wordpress.org/support/plugin/default-theme-pages/)

## 外掛說明

#### This plugin is intended to be useful for template developers

#### New in version 0.4

 * added ‘object’ (page object) in every $default_theme_pages item for fast access.
 * added all default pages to wp toolbar, inside ‘site name’, to increase user experience.

#### How to use

Add this code in your _functions.php_.

    ```
    global $default_theme_pages;
    $default_theme_pages = array(
        array(
            'name' => 'home',               // initial slug page / id for templating - access functions
            'title' => 'Homepage',          // page title
            'option' => 'page_on_front',    // option page id ( stores the page id in an option, use only in theese cases)
            'description' => 'homepage'     // description
        ),
        array(
            'name' => 'blog',
            'title' => 'Blog',
            'option' => 'page_for_posts',
            'description' => 'blog'
        ),
        array(
            'name' => 'contact',
            'title' => 'Contact me!',
            'description' => 'Contact form page'
        )
     );
    ```

#### Tips

 * After the pages are created automatically, you can change their title and slug
   without problem.
 * If you add an `option` names: `page_on_front` and `page_for_posts`, you will 
   block the _home-page_ and the _blog-page_ on your site.

#### Templating

You can template using **ID** or **name** (setted up in $default_theme_pages global
variable ), something like:

**page-131.php** or **page-contact.php** (If you change the page slug, this will
still work because ‘contact’ was defined as _pagename_ if $default_theme_pages global
variable).

For detect if you’re in that page:

    ```
    dtp_is_page('contact')
    ```

Getting a default page id:

    ```
    $page_id = dtp_get_page_id('contact');
    ```

This method is more quick than _get\_page\_by\_path_ because page ID is stored on
global variable.

## 螢幕擷圖

 * [[
 * Admin pages list

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈Default Theme Pages〉的開發相關工作。

參與者

 *   [ Carlos ](https://profiles.wordpress.org/carlos_a_sanz/)

[將〈Default Theme Pages〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/default-theme-pages)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/default-theme-pages/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/default-theme-pages/)，或透過
[RSS](https://plugins.trac.wordpress.org/log/default-theme-pages/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/default-theme-pages/)。

## 變更記錄

#### 0.4

 * added ‘object’ (page object) in every $default_theme_pages item for fast access.
 * added all default pages to wp toolbar, inside ‘site name’, to increase user experience.

#### 0.3

 * changed stored system to gain performance
 * added ‘id’ in every $default_theme_pages item for fast use
 * added some accessible functions: `dtp_is_page`, `dtp_get_page_id`
 * added default pages in template system, now you can template a default page as:`
   page-name.php`

#### 0.2

 * blocked status modifications
 * blocked move to trash

#### 0.1

 * Initial release

## 中繼資料

 *  版本 **0.4**
 *  最後更新 **14 年前**
 *  啟用安裝數 **10+**
 *  WordPress 版本需求 ** 3.0 或更新版本 **
 *  已測試相容的 WordPress 版本 **3.4.2**
 *  語言
 * [English (US)](https://wordpress.org/plugins/default-theme-pages/)
 * 標籤:
 * [block](https://tw.wordpress.org/plugins/tags/block/)[pages](https://tw.wordpress.org/plugins/tags/pages/)
   [templating](https://tw.wordpress.org/plugins/tags/templating/)[theme](https://tw.wordpress.org/plugins/tags/theme/)
 *  [進階檢視](https://tw.wordpress.org/plugins/default-theme-pages/advanced/)

## 評分

這個項目尚無任何評論記錄。

[Your review](https://wordpress.org/support/plugin/default-theme-pages/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/default-theme-pages/reviews/)

## 參與者

 *   [ Carlos ](https://profiles.wordpress.org/carlos_a_sanz/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/default-theme-pages/)