2 added 424 characters in body
source | link

I'm recoding my website with custom post types to be better organized, have a better search experience and being able to hide some pages from other contributors, but I have a little problem.

I've set up a post type named Files which contains some files that my contributors should not see. Basically the legal pages, the contact page and so on.

As I had all the pages in the default Pages post type I was able to select a template for each page in the page attributes. Now in my new custom page type, I can only select the order of the page and nothing else. So I have a template for the legal pages and another one for the contact page, which includes all the phpPHP code. How can I select these templates in my new custom post type?


EDIT

Okay, I've understood, that it's only possible to set a template by setting up a PHP file named single-*(post_type_name)*. But as I said, I've two different templates, and more will come very soon, so how can I set these to one or maybe two posts inside that post_type. There must be a possibility, isn't it? The makers of WordPress will unlikely have us create a new post_type for a single file...

I'm recoding my website with custom post types to be better organized, have a better search experience and being able to hide some pages from other contributors, but I have a little problem.

I've set up a post type named Files which contains some files that my contributors should not see. Basically the legal pages, the contact page and so on.

As I had all the pages in the default Pages post type I was able to select a template for each page in the page attributes. Now in my new custom page type, I can only select the order of the page and nothing else. So I have a template for the legal pages and another one for the contact page, which includes all the php code. How can I select these templates in my new custom post type?

I'm recoding my website with custom post types to be better organized, have a better search experience and being able to hide some pages from other contributors, but I have a little problem.

I've set up a post type named Files which contains some files that my contributors should not see. Basically the legal pages, the contact page and so on.

As I had all the pages in the default Pages post type I was able to select a template for each page in the page attributes. Now in my new custom page type, I can only select the order of the page and nothing else. So I have a template for the legal pages and another one for the contact page, which includes all the PHP code. How can I select these templates in my new custom post type?


EDIT

Okay, I've understood, that it's only possible to set a template by setting up a PHP file named single-*(post_type_name)*. But as I said, I've two different templates, and more will come very soon, so how can I set these to one or maybe two posts inside that post_type. There must be a possibility, isn't it? The makers of WordPress will unlikely have us create a new post_type for a single file...

1
source | link

Add a Template to a custom post type

I'm recoding my website with custom post types to be better organized, have a better search experience and being able to hide some pages from other contributors, but I have a little problem.

I've set up a post type named Files which contains some files that my contributors should not see. Basically the legal pages, the contact page and so on.

As I had all the pages in the default Pages post type I was able to select a template for each page in the page attributes. Now in my new custom page type, I can only select the order of the page and nothing else. So I have a template for the legal pages and another one for the contact page, which includes all the php code. How can I select these templates in my new custom post type?