WordPress Custom Post Templates

Once you have built a Wordpres custom post, you will often want to style it using it’s own template.

I searhed the web for a solution and courtesy of twothirdsdesign, if found the answer.

The template used for a custom post view is decided by the ‘get_single_template()’ function in the wp-includes/theme.php file.  And it basically tells locate_template() to look for single-’post_type’.php or single.php.

So the simplest way to customise the way a custom post is displayed is to add a template file to your theme with the name single-xxxxxx.php

Simples!

Tags: , , ,

WordPress SEO: 10 tips for better search rankings

FREE E-book. Learn the basics of WordPress SEO and how to improve the key metrics
  • We won't sell your address to anyone. We hate spam too.
View my portfolio Get in touch

Leave a Reply