I'm stucked at some point developing my theme.

I created a custom posts types to support an image gallery. So far, it's working great (have a look on 'galeria' on psaikali.com). I registered this custom post type (register_post_type( 'artwork', $args )) and activated the 'page attributes' function, to define a different template for my posts ('supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes', 'custom-fields' )).

But it just shows the 'order' of the page, not the 'template selection' part. Does anyone knows what's wrong ? I did create the template file called single-artwork.php ...

Screenshot of the page attributes page I see : http://img213.imageshack.us/img213/5348/notemplate.jpg

Thanks for the help !

2 Answers 2


You should be able to create a single-your-post-type-name.php file and have it work. I currently have it working fine on 3 or 4 sites so if it's not working for you you're doing something wrong.

Based on your code sample single-artwork.php should work as a single page post template. You could also redirect on single.php with:

if( get_post_type() == 'artwork' ) {
include_once ( TEMPLATEPATH.'/path/to/template.php' );
} else {
include_once( TEMPLATEPATH.'/normal/template.php' );

I'd prefer to see the single-posttype.php route since WordPress is doing the routing at a deeper level and it's always nicer to just use WordPress built in stuff.

  • Thanks for the answers, the single-artwork.php was not working, but now it is. I guess that last time, I had the single-artwork.php BUT no single.php. That's why it was redirecting to my index.php. Anyway it's working now !
    – Pierre
    Oct 27, 2010 at 15:04
  • Glad I could help. If this worked then please accept the answer. Oct 28, 2010 at 1:50

well single-POSTTYPE.php is for the single view of that post type. Do you actually have a file my-custom-template.php which looks like this?

Template Name: My Custom Template

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.