How to create wordpress page templates

Recently i had to find a way to List subcategories the way wordpress lists posts. After some extensive searching and facepalming that this isn`t included in the built-in functionality I started researching how to develop this and stumbled upon wordpress page templates. I found that to be the easiest way to build and use custom loops or any kind of custom PHP for that matter. The best part is that creating a page template is as easy as inserting several lines in a PHP file from your favorite text editor, upload it in your themes folder and you are good to go…Your Page template file must start with:

Template Name: Snarfer

After you upload it in your wordpress folder you can access it in the page attributes of the “Add new page”

Of course this is just the beginning…you can now start coding. And including your code is as easy as adding a new page.

  • I wnetad to spend a minute to thank you for this.

    • hello there and thank you for your info – I’ve definitely pkcied up anything new from right here. I did however expertise several technical issues using this web site, since I experienced to reload the site many times previous to I could get it to load properly. I had been wondering if your hosting is OK? Not that I’m complaining, but slow loading instances times will very frequently affect your placement in google and could damage your quality score if advertising and marketing with Adwords. Anyway I am adding this RSS to my e-mail and can look out for much more of your respective interesting content. Make sure you update this again very soon..

      • admin

        I`ve never noticed any technical issues on the host, but I`ll definately keep an eye open….We`re working on a better theme for this project so any theme related problems will disappear once we`re ready…I`m glad you liked my content and thanks for taking the time to write a comment!

  • I think that’s it. Oh, if you need help or information on WordPress telematps, I’d suggest looking through the WordPress Codex articles on Templates and Themes. Update [Aug-21-2005]: R1.1 fixes a bug where if no single-cat template exists, single.php (if there’s one with the theme) fails to load by default (Thanks Aeos for catching it!). This update also attempts to step around a conflict with Ryan Boren’s Custom Post Template plugin. Update [Feb-26-2006]: R1.2 Verifies that my Category Template Inheritor plugin is active, and if it is it attempts to find a $template_name-category parent ID.php template (that is, a template for the parent category (if it has one) of the post’s category).

  • Very interesting information!Perfect just what I was looking for!

  • I like this web site so much, bookmarked.

  • It’s really a great and helpful piece of info. I’m happy that you simply shared this useful info with us. Please keep us informed like this. Thanks for sharing.

  • I have recently started a website, the information you offer on this site has helped me tremendously. Thank you for all of your time & work. “So full of artless jealousy is guilt, It spills itself in fearing to be spilt.” by William Shakespeare.

  • I dugg some of you post as I cerebrated they were very helpful invaluable