[wp-hackers] Template Hierarchy In A Plugin

Alex Andrews awgandrews at gmail.com
Fri Aug 5 22:25:03 UTC 2011

 Dear all, 

What is the best way to take advantage of the way in which WordPress automatically guesses, and correctly loads the right template for a custom post type, but within a plugin rather than a theme?

So in a plugin I load a series of custom post types, and tell WordPress where the template files for them are, which it then loads in an automated manner. So album-single.php loads as we would expect if it were under the template directory and so on? 

I attempted to Google this, but obviously quite difficult to get through the thickets of results to it out!

Thanks for the help,


Alex Andrews
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

More information about the wp-hackers mailing list