Wordpress Page Templates

by Dan

image Wordpress has a functionality that I have never used before that allows you to create pages rather than just posts. I never really found a reason for this until recently where I decided to change my landing page to go to this new page in my blog I created. After creating the page I didn’t like the fact it had a post date, a category classification, and the comments section. Looking into Wordpress.org I found out how I can attach a specific template file to a specific page. This was pretty easy but I figured I would write it down so I wouldn’t have to search for it again.

  1. Copy the page.php file from the current theme
  2. Create a new file with the copied contents from page.php
  3. Add the following code snippet to the new file
  4. <?php
    /*
    Template Name: About
    */
    ?>
  5. Edit the file to be how you want it, and upload to your template directory
  6. In Wordpress when editing or creating the page you should see a new dropdown that allows you to choose the page template (see image for post)

That’s it now you have a new customized page template for whatever you want to do!

Related posts:

  1. Change Default Uploader in Wordpress For some reason some of my sites always freeze...

Related posts brought to you by Yet Another Related Posts Plugin.

Comments are closed.