Quick Recipe For Custom Pages In WordPress
There are many situations when you need to have a different layout for a certain page in a WordPress blog from various reasons. For example, a banner does not fit to the layout offered by the default page template or you just want to remove a sidebar because an iframe does not appear correctly. The solution for these issues is simpler than you might think: WordPress platform supports more pages templates with different layouts, that can be selected while a new page is edited or created from the administration area.
In the first place, you will have to isolate the PHP file corresponding to the default page template inside the currently selected WordPress blog theme directory. Open it with a text editor or directly from your WordPress administration area, copy its content and then close the file.
Create a new file called custompage.php and paste the clipboard content into it. Now, you can customize the new template for WordPress pages. For example, you can remove the footer, add a new sidebar or embed a movie.
After you have performed the necessary changes to the custompage.php file, add the following code above other lines of code existing into the file:
<?php
/*
Template Name: Custom Template
*/
?>
The name of the template makes easier the differentiation of it from the default WordPress page template. Now, you must save the file and upload it into the currently active WordPress theme directory on your web server.
When you will create a new page, in the left side of the WYSIWYG editor, the option to select the newly defined page template will be found (you will see a drop down box with the default page theme selected). You just have to select the Custom Template and the published page will reflect the desired changes as compared with the default WordPress blog page template.
Tags: content management system, Content Management Systems, developer tools, Tutorials, Web Developer Articles, wordpress, WordPress Security FlawsRelated Articles


























































