Wednesday, 26 September 2012

How to create a new page template in Wordpress?

In wordpress usually there is no option to select page template after a new installation. It will be usually located in the Edit page section of wordpress backend. Right side of this page you will find Page attributes with Parent and Order section. Once you created a new page template there will be another option called Template(Drop down).

Navigate to themes your folder which looks like this wp-content\themes\urtheme.
create a new php file or copy the existing page.php file in the same folder with your new template name. Then open that file and place the below code at the top of the page.
<?php
/*
Template Name: Home
*/


Home is the new template you created. Just go the Edit page of backend and you'll find template under Page attributes. There you can select your template for the page. That It! Then you can modify the new template you created as you wish.

No comments:

Post a Comment