WP Snipp Ninja

How do I add a template to WordPress?

Author: WordPress Snippets | Posted on: March 1, 2019 |

In WordPress, we call a template the page templates, they change the appearance of a single page.

If you are looking at how to change the whole site appearance please check “How to add a WP template”, as this article won’t be helpful for you as it is created to explain the page templates.

That being said let’s go!
Adding a custom template is a dev task and you will need some coding knowledge. First login to your FTP and create a file [myTemlateName]-template.php . It really doesn’t matter how you will name them but I would recommend using suffix or prefix (template, page) that will quickly let you know that this is a page template.

Next, open the newly created file and on top add:

<?php /* Template Name: My Template Name */ ?>

After saving, the template will be visible inside the WP admin and it can be set on a page however, having the file only with the template tag won’t be of any use as it won’t show anything just a blank page.

For the page template to be fully functional you will need to input all the needed code inside based on your specifications and I’m leaving it up to that as you will need to do a lot of research and learning if you don’t know what is supposed to go in there starting with:
Get WordPress Header
Get WordPress Footer
WordPress Loops
WordPress Page Templates

Have a great one!

About the Author

 WordPress Snippets

Hello my name is Dimitar Krumov I am from Sofia Bulgaria but live in Varna on the Black Sea coast.I am a Web Developer since 2002 working in different Web Projects most of them are international and business-related. Some of my knowledge and skills but not limited to WordPress, HTML, CSS, Google Stack, Analytics, SEO and more..

Follow WordPress Snippets on Social Media

Leave a Reply

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