Loading...


Loading...

Welcome!

Sign up for a free account, or log in here.

Member Login

You can login by following the link.

Not a Member? Sign up! It's Free!

Please feel free to register.

Click to log in.

Custom WordPress Page Templates

The usual templates are usually all that theme designers use. They basically let the WordPress back-end put all the information in (i.e., from the Loop) and display it as the theme.

Creating a custom page is of course, easy in WordPress. Instead of going to Write then Post, it’s as simple as clicking on Page instead of Post. That’s a page, and it sits outside the normal chronological flow of posts in your blog.

So assuming you have your blog designed, but you want to add another sidebar for specific pages (note: not posts). You have to create a template just for that page. Bear in mind though, you already have page.php which is the standard page template that pages use.

Let’s call this new template alternate.php. First, copy page.php and rename it to your new template. Second, add in your extra sidebar, or whatever code you want to use, then the most important part is to name it so your WordPress blog recognises it. Put this right at the top:

<?php
/*
Template name: alternate
*/
?>

Simple as that really. Upload your alternate.php to your theme directory. Now, in your Write->Page section you have the normal layout where you write the text, the title, and so on, and scrolling down there is a section called ‘Page Template’ like this:

The dropdown menu will list your new page template as alternate (the name you used at the top of your template). That’s it, select your template and save/publish your post and it will use that new layout for your page.

This is quite a powerful way of making specialised pages within your theme. Adding an extra sidebar is one example, but also examples such as extra images, including external feeds, or specialised forms, are ways of extending the usefulness of your theme without requiring an entirely different theme.



Leave a Reply



You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


The English Guy on Twitter

Raised Paper WordPress Theme

Raised Paper WordPress Theme screenshot
Theme Price

Onyx WordPress Theme

Onyx WordPress Theme screenshot
Theme Price

Victoriana WordPress Theme

Victoriana WordPress Theme screenshot
Theme Price

Expression Blue WordPress Theme

Expression Blue WordPress Theme screenshot
Theme Price

Premium WordPress Theme Release: Natural Green

Premium WordPress Theme Release: Natural Green screenshot
Theme Price

Theme Release: Ikon WordPress Theme

Theme Release: Ikon WordPress Theme screenshot
Theme Price

Shocking WordPress Theme Release

Shocking WordPress Theme Release screenshot
Theme Price

Digitalis WordPress Theme Release

Digitalis WordPress Theme Release screenshot
Theme Price

WordPress Theme: OpenAir Theme

WordPress Theme: OpenAir Theme screenshot
Theme Price

WordPress Theme: Very English

WordPress Theme: Very English screenshot
Theme Price

News Print v3.0 WordPress Theme Released

News Print v3.0 WordPress Theme Released screenshot
Theme Price

Reclamation WordPress Theme

Reclamation WordPress Theme screenshot
Theme Price