How to create a new page template in WordPress?
The first step: Create a new empty file under the current theme, such as: page-member.php;
The second step: Copy the following code to the newly created file, Then save and transfer it to the server. At this point, the template page is created, and the text part can be freely used;
<?php /* template name: member */ get_header(); ?> 正文部分 <?php get_footer(); ?>
Step 3: Log in to the backend - Page - Create a new page, and give it a name such as "Member Center". Then select the page template member (this name is the template name of the template file), as shown below. After saving, view the page, which is exactly what we created.
Some tips for page templates:
You can fill in the word member that appears in this article freely, and it is recommended that it be in English;
Page Templates are PHP files, which means you can write dynamic scripts to get what you want, not just static code;
Page templates can be used on multiple pages, which is why they are called templates.
The above is the detailed content of How to add template page in wordpress. For more information, please follow other related articles on the PHP Chinese website!