Creating Wordpress Page Temlates
Posted by Asuka_Aki | Posted in Design, Wordpress | Posted on 08-06-2008 |
Did you ever want to have one page display a different sidebar or a different footer? Or perhaps one an only one page without a sidebar at all? I was looking for help on the subject and did not find anything step-by-step. So I played around with the templates function and wrote my own tutorial.
Creating a different Sidebar or Footer File
1) Use FTP to download a copy of sidebar.php file
2) Opened it up with a html editor like wordpad or whatever you have
3) Edit the code like you want and save your file with a different name when you’re done.
4) Upload via FTP the new sidebar2.php or footer2.php to:
yoursite.com/wp-content/themes/your_theme
5) When you are logged in to you WordPress admin panel, you should see your sidebar2.php or footer2.php listed in Design> Theme Editor
Creating a New Page Template
In order to use your new footer or sidebar you need to create a page template. The easiest way to do this is download a copy of your index via FTP. Using your index preserves the style. apply the following changes and upload the new file via ftp to: yoursite.com/wp-content/themes/your_theme
Use an html editor and change the name of the page template:
<?php /* Template Name: MyPage (Whatever you put here is what appears in your theme template list.) */ ?> |
To show the original header, sidebar or footer use these codes:
<?php get_header(); ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
To show your new header2, sidebar2 or footer2 substitute the regular line which calls for:
<?php include (’header2.php’); ?>
<?php include (’sidebar2.php’); ?>
<?php include (’footer2.php’); ?>
Using a Page Template
If you’ve successfully created your page template you will be able to assign it when you write your pages.
login to your admin’s dashboard, click “write” then click on “page” you should have a drop down menu at the bottom. Choose your page template and save your page.
That’s it you can now create page templates and call different footers and headers to suite your needs.
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!




[...] August 18, 2008 by blogpusher Did you ever want to have one page display a different sidebar or a different footer? Or perhaps one an only one page without a sidebar at all? I was looking for help on the subject and did not find anything step-by-step. So I played around with the templates function and wrote my own tutorial…Read more? [...]