最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

posts - How to create a template for Pages?

programmeradmin3浏览0评论

In Wordpress, when creating a page, it shows some options for Template under Attributes, such as: Default, Links, One column no sidebar, etc.

Is there a way to add more custom templates to show up here? If so, how?

In Wordpress, when creating a page, it shows some options for Template under Attributes, such as: Default, Links, One column no sidebar, etc.

Is there a way to add more custom templates to show up here? If so, how?

Share Improve this question asked Jan 10, 2013 at 7:49 Click UpvoteClick Upvote 2231 silver badge8 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 3

All you need to do is just create a new file in your theme root directory. This file must start with following code:

<?php 
/**
 * Template Name: No Sidebars
 */ 

Name your file, for example, page_nosidebars.php and then WP will add No Sidebars template to available templates list.

There is nice article about it Creating Custom Page Templates. I think it will help you to create your own.

You can create your own template for pages. Below link shows the example of creating template.

Url :- http://codex.wordpress/Pages#Creating_Your_Own_Page_Templates

create a php file and save in active theme folder.

<?php
/*
Template Name: Snarfer
*/
?>

i think this may help u for creating template.
发布评论

评论列表(0)

  1. 暂无评论