WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 !

share|improve this question

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.

share|improve this answer
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 '10 at 15:04
Glad I could help. If this worked then please accept the answer. – curtismchale Oct 28 '10 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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.