Page Template

In this lecture, we are going to talk about page templates. As you know we created pages before. But that page route with page.php file and also they all look same. That’s why wordpress gives us page templates to design different pages in different designs and layouts.

Firstly create a separate folder for all layouts and add php files in that folder and assign that designs respectively.

Page Template
For a global template, write a comment at the top of the file with the name of the template, just like below.

<?php 
/* 
* Template Name: About Us 
*/ 
?>

 

Page > Edit
On the right side of the page section under attribute, you will see the template. Select your template just like below.

Template Section

After setup up the template, create your own custom page layout design.

#BeingCodeStuffer

Related Theme Developments