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!

Want automatic updates? Subscribe to our RSS feed or
Get Email Updates sent directly to your inbox!
Tweet This | | Digg This | Stumble it | | Print This |

Kyle Eslick is WordPress enthusiast who took his passion for WordPress to the next level back in 2007 by launching WPHacks.com as a place to share hacks and review WordPress-related products.

There is 1 Response So Far »

  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 »

Leave a Reply