How to create a new template?


What is a wordpress template?
A wordpress template is a .php file that will control how your wordpress page would look like. So let’s say you want a specific page to have the same look of the theme, but with no navigation. A template will make it possible. But how? You should first know how to create a template.

Its easy. Step 1: create a new .php file using an editor like notepad, dreamweaver or other similar software. In dreamweaver, click File > New. Then on the new window choose page type as PHP and press create.

Step 2: open your page.php. Copy all the contents to the new .php document. You can remove some line of code. For example to have a one-column page just remove
<?php get_sidebar( ) ?>

Step 3: on the new document, add this on the top most part:

<?php
/*
Template Name: Full-width, no sidebar
*/
?>

You can choose whatever name you like, but I suggest to keep it short and descriptive. It will be shown in the page attributes when you create a page. See image below.

Lastly, save your .php file to any name you want, it does not matter. After that, upload it to your site. It should be in the same directory where your page.php is.

That’s it. You have created a new template. When you create a page, just choose it from the page attributes as shown in the image above.

Continue to Part 2..

Advertisements

About freelance webmasters

We a re a group of webmasters designing professional facebook pages, twitter, youtube and wordpress sites at affordable prices. View all posts by freelance webmasters

One response to “How to create a new template?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: