Creating a custom WordPress page template is essential and should be a part of every WordPress developers skill set. Page templates allow you to drastically change the structure of a specific page, as well as having specific code run only when that page is loading.
Creating a page template is simple and although there are plugins available to assist you in doing this, today we will show you how to do this with just a few simple steps.
1. Go to the site’s theme folder (this should be the theme currently being used. )
Copy and paste the page.php file to a blank folder. Now rename page.php, for this, I will rename it to custom-page.php.
2. Next, open custom-page in a text editor and add this code just below the get_header tag:
<?php /* Template Name: Custom Page */ ?>age */ ?>
3. Copy and paste custom-page into the sites theme folder.
4. To use the custom template in your pages, login to the WordPress admin area.
Go to Pages > Add a new page. In the page attributes section click on the drop tab labelled Template and select the custom page you just created.
Voila, your custom page is ready to use in WordPress – pretty easy right?
For more web design-related stuff, read this blog of ours from awhile back.