Page templates are very useful: They allow you to creates custom pages, for exemple creating an archive page which will list all your posts, or a page to display infos about the author.
A page template is defined by the following code, inserted on the firsts lines of the file:
<?php
/*
Template Name: Archives
*/
?>
Here, we just created a page template, named "Archives".
To use it on your theme, write a page, and scroll down until you see a "Page Template" dropdown list, as described in the picture below:
Then you just have to choose which page template to use, and save the page.
No comments:
Post a Comment