WordPress Default Page Template


In this article, we will create WordPress Default Page Template. If you are wondering what is WordPress default page template is?. WordPress default page template is the layout page which can use to change the layout of the particular page. let’s find out WordPress default page template in detail.

Suppose if you have a page layout of only one column. You need to change the layout to two different pages. Then if you want to change these pages columns then you want to change the code for both these pages. So WordPress will help you to create a single file to change the layout of the page.

WordPress Default Page Template

You will see in above image we change the layout of the page. So we just added notes area on the page layout.

let’s jump into the code.

Special-template.php

Now we will create file call special-template.php. This file will use to change the page layout. Now the only thing is that we need to specify this template file to the pages which we wanted to change.

You can specify any name for this file as per your requirement.

After you create this file copy and paste index.php file code in this file. and run your site. You will see nothing will happen because we don’t change anything yet. So now we will change index.php file.

Import this code in special-template.php

On the top of the page, we created comment which demonstrates template file. So in the comment specify template name. You can see the template name in the page attribute section.

Now in this file, we added declaimer class and insert notes text on the right side of the page.

So now go to the page which you wanted to change these page layout. On the right side of the screen, you will see the page attribute section. From the page attribute section select template for your page. You can create multiple templates for your website pages.

So to change page layout select this template and click on update. You will see your page layout was changed.

To change other pages layout you can create multiple layouts for the different pages. So Create template files and specify for the page. as simple as that.

If you have any question then comment me in the comment section. Follow us on Instagram and Facebook. Know more about us on Youtube.

I will meet you in the next article.

Look out some more related article on WordPress and other languages.

Thank You.

Leave a Reply

Your email address will not be published. Required fields are marked *