To start, create a new file under your theme folder. In this case I’ll be creating a
custom-page.php file under the
wp-content/themes/twentyfifteen directory of my Wordpress installation. Then add the following code in the file:
1 2 3 4 5 6
Yes, that’s all there is to it. Note that the
Template Name: part is very important. You can assign any value that you want as long as its descriptive. This specific comment is used by Wordpress to recognize your file.
To assign this page to a specific Wordpress page. You can add a new page from Wordpress admin page and select the page that we have created under the Template drop-down:
Now when you access the page from your browser, you will get that awesome heading. From your custom page you can also use the methods available on all the Wordpress APIs and also the built-in theme functions such as the