Menü schliessen
Created: March 10th 2021
Last updated: December 10th 2021
Categories: Php,  Wordpress
Author: Tim Fürer

WordPress: Create a basic Template

Tags:  guide,  PHP,  Template,  wordpress

In this very short guide, I'll show you how to make a basic WordPress Template.

If you haven't made a WordPress Theme yet, consider reading this guide first.

Creating the WordPress Template

Inside your WordPress Theme folder, create a file that is named something along the lines of "template-something.php".

For your Template to work, you need to include a header Comment, just like when making a Theme:

<?php
/**
 * Template Name: Something Template
 */

And here is some code you can use as the base of your Template:

get_header();
if (have_posts()) {
	//code
}
get_footer();

This is how your code might look like:

WordPress Theme Code Example

If you need more information, check out the official WordPress Documentation on Templates.