I'd like to pre-define page_template choice in the page attributes when creating a new post in a custom post type.

Found lots to do with adding parents defaults, but stuck getting past that.

3 Answers 3


You need to create the template files within your theme using the correct naming.

Please see:


  • 1
    I guess I wasn't clear - I want the template auto selected when I add a new post / page / custom post type. So under page attributes, my client doesn't have to keep selecting page template and selecting the custom template from the drop down box. Jul 17, 2017 at 12:37
  • 1
    Please take a look at: wordpress.stackexchange.com/questions/204657/…
    – lky
    Jul 17, 2017 at 12:48

It's in the filename. single-$posttype.php, archive-$posttype.php

  • 1
    maybe I wasn't too clear - I want the custom template, using the newer method of template identification that heady12 references above, auto selected when I click new page (or new custom post type) Jul 17, 2017 at 12:36
  • How many different templates do you need per post type (foo)? If it's one, call it single-foo.php, if it's more than one call the default single-foo.php and use the Template Post Type header in the others.
    – Chris Cox
    Jul 17, 2017 at 13:01

As heady12 pointed out

Apply template to custom post type

With some modifications to conditions this worked.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.