Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

WordPress WordPress Theme Development Custom Post Type Templates in WordPress Coding Your Own Custom Post Type Templates

Elena Paraschiv
Elena Paraschiv
9,938 Points

I ma getting this error: Please choose a different post type name...

Imgur

When I follow the video instructions and try to create a custom post I am getting the error above How can I solve this ?

3 Answers

Stanley Thijssen
Stanley Thijssen
22,831 Points

Hi Elena,

I think you WordPress installation already has a page named portfolio. Thats why you can't create a custom post type with the name of portfolio. If you try to change it to a different name it should work.

That is correct- just rename your Portfolio page to My Portfolio or something - NOTE that you will also have to change the permalink (page slug) so it reads /my-portfolio or whatever.

Peter Simmons
Peter Simmons
3,371 Points

I think its a new feature of the plugin custom post type ui that has been introduced since this video. Its not recommended to have custom post types the same as page names as it can cause weird behaviour. I have started to name all my custom post types like CPT_NAME now as there is never a risk a page will share that name and then you can rewrite the url slug later if needed.

Glenré Charl Labuschagné
Glenré Charl Labuschagné
23,202 Points

Random work around: Delete the Portfolio page before following the video instructions. After completing the instructions, go back and add the Portfolio page & re-add your (deleted) Portfolio page to the Menu.