By default, WordPress displays your php files by whatever the file name is. That means if you name your file wordpress.php, that is how it will show in your WordPress editor. When working with page templates, or if you just want to keep your files a little more organized, you’ll probably want to give your templates names.

Here is all you need to do. Paste the following code at the top of the file:

<?php
/*
Template Name: WordPress PHP
*/
?>

Now change WordPress PHP to be the name you want to use. Easy enough, right?  Tomorrow I’ll be posting a little more about page templates!

Kyle Eslick is WordPress enthusiast who took his passion for WordPress to the next level in 2007 by launching WPHacks.com as a place to share hacks, tutorials, etc. Follow Kyle on Twitter @KyleEslick!

  1. Suneel says:

    So simple, yet so effective in organising the horrendous and messy file structure that we at times get lost in.

    Thanks.

Trackbacks/Pingbacks »

  1. PHP Coding School » Blog Archive » php tips [2008-04-10 12:45:00] says: