large shade tree

Navigation

Information

Recent Posts

Shade Tree Sites |Building Better Websites

WordPress Custom Post Templates

Similar to creating custom page templates you can create custom post templates.

Create a new file using a text editor ( As I've said before I use notepad ) at the top to the new file place the following code without the brackets ( I have to include the brackets so the code will show up in the post ) and include your name for your template. As before be careful to not duplicate a name your theme is already using - you don't want to inadvertently overwrite something.

[<?php
/*
Template Name Posts: Place Name of your Post template here
*/
?>]

Then design/create your new post layout/template using html, php or combo.  Again I usually start with a copy of the default post template and them customize it, but you of course can do whatever you wish.  Upload your completed post template to your active theme folder (you will need control panel access or ftp access to accomplish this)

Then install and activate the plugin Custom Post Template  Author: Simon Wheatley from wordpress.org.  Once activated just beneath the content editor area you will find a new dropdown menu with the name of your default post template and your new post template - choose which template to apply to each post as you see fit.

I have found this very useful particularily in sites that use a product catalog - I can design a unique product / item template which and therefore set items apart visually from the rest of the site.  However, there an unlimited number of uses for this plugin and technique - you could, in theory, create a unique layout for every post you write if you so desired.

Have fun trying this out!

Comment Pages

There are 1 Comments to "WordPress Custom Post Templates"