Drupal 7 custom template files per content type

Very useful – got this from here where you can also find the one for D6.

As the comment suggests, if you have a content type called ‘blog’, you can create a template file to apply to nodes with this content type only called page–blog.tpl.php.

<div class="codeblock"><code><span style="color: #000000;"><span style="color: #0000bb;">&lt;?php
</span><span style="color: #007700;">function </span><span style="color: #0000bb;">themeName_preprocess_page</span><span style="color: #007700;">(&amp;</span><span style="color: #0000bb;">$vars</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$hook</span><span style="color: #007700;">) {
if (isset(</span><span style="color: #0000bb;">$vars</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'node'</span><span style="color: #007700;">])) {
</span><span style="color: #ff8000;">// If the node type is "blog" the template suggestion will be "page--blog.tpl.php".
</span><span style="color: #0000bb;">$vars</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'theme_hook_suggestions'</span><span style="color: #007700;">][] = </span><span style="color: #dd0000;">'page__'</span><span style="color: #007700;">. </span><span style="color: #0000bb;">str_replace</span><span style="color: #007700;">(</span><span style="color: #dd0000;">'_'</span><span style="color: #007700;">, </span><span style="color: #dd0000;">'--'</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$vars</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'node'</span><span style="color: #007700;">]-&gt;</span><span style="color: #0000bb;">type</span><span style="color: #007700;">);
}
}
</span><span style="color: #0000bb;">?&gt;