Current location - Education and Training Encyclopedia - Educational Knowledge - How to add a page template in wordpress
How to add a page template in wordpress
Create a new template in your theme folder and name it tags.php. Then copy the contents of the page.php template to the tags.php file. Next, find the place where the sidebar is called in the template file and delete or comment it. You may also need to find the content div tag and manually add a width style to it to expand the width so that it can fill the entire container div tag.

When finished, insert the following code at the top of the tags.php:

Now it's time for us to use the WordPress management interface to make the tab page use the tab page template, as follows:

Go to create a new page, or edit the tab page if you have already created it. On the right, you will see some different titles, such as smooth road, page status, page password, parent page, page template, page abbreviation, page author, page order, etc. Click the plus sign next to the page template, find the tag in the drop-down list, select it and click Save. Now your tab and other pages use different themes.