Transferred from: http://jingyan.baidu.com/article/066074d6817060c3c21cb02e.html
<?php
/*
Template Name: Friend chain
*/
?>
This "friend Chain" is the title of the template selection.
Used for a while WordPress people will this wordpress: Custom page template. But there are many newbies who don't know the page template feature. Here is an introduction.
The role of page templates
Let WordPress pages have different layouts or styles. WordPress provides a page function that allows us to create different pages to show different content. such as contact information, message book and so on, many people like to build this. These pages are well established and can be customized with titles and content. But different pages, the layout is exactly the same, can not be changed according to their own needs and add. Sometimes we just want to add something to the sidebar of a page, such as a picture, so that you can customize the template to achieve a specific function of the page.
Method/Step
- 1
Create a new PHP file in your theme directory using the FTP tool. For example: links.php (name Random).
- 2
Edit the new file and add this code to the header of the file.
<?php
/*
Template Name: Friend chain
*/
?>
- 3
Copy the contents of your page.php directly into the links.php.
- 4
Then find where you need to change in the links.php. I think, the most important change is the sidebar, one is the content of the article, as to how to change, depends on your needs.
- 5
After modifying and saving the file, create a new page or modify the existing page. In the bottom right there is a "page template" Panel, in the drop-down menu, select "Friend Chain" to save it.
END
Precautions
Links.php can be anything, not necessarily to copy the contents of page.php.
You can even put HTML code in it without adding anything else.
WordPress: Customizing page templates