默認頁面模板page.php
(如果不存在,index.php
將被使用)這應該是在你的主題的根文件夾,並創建一個自定義頁面模板,你應當命名爲
page-{slug}.php
// or
page-{ID}.php
,並把這個你的主題的根文件夾中了。例如,如果你想創建一個自定義頁面模板lol
那麼它應該是保存使用名稱page-lol.php
並把這個起初,這個模板文件,這將是在template
組合框(Lol Page
)
<?php
/*
Template Name: Lol Page
*/
可見
我twentythirteen
主題文件夾
wp-content
themes
twentythirteen
// other files
page.php
page-lol.php
style.css
// other filse
截圖:(Read more on Codex)
更新:我不知道,如果你正在做的是正確的,如果你沒有一個style.css
文件,然後WordPress
不會承認你的主題,並在您style.css
文件,你必須把一些資料(樣式表頭)以及(WP需要這些信息),這裏有一個例子(Read more on Codex)
/*
Theme Name: Twenty Thirteen
Theme URI: http://wordpress.org/themes/twentythirteen
Author: the WordPress team
Author URI: http://wordpress.org/
Description: The 2013 theme for WordPress takes us back to the blog, featuring a full range of post formats, each displayed beautifully in their own unique way. Design details abound, starting with a vibrant color scheme and matching header images, beautiful typography and icons, and a flexible layout that looks great on any device, big or small.
Version: 1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: black, brown, orange, tan, white, yellow, light, one-column, two-columns, right-sidebar, flexible-width, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, translation-ready
Text Domain: twentythirteen
This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/
此外,請確保您已經激活了您的主題,從管理面板Appearance -> Themes
菜單。
確保你標記你的答案一旦你能夠這樣做,接受,讓其他人可以從你的經驗中受益。很高興它解決了。 –
@PatJ是的,會做的,謝謝你! –