Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress WordPress Theme Development Custom Post Type Templates in WordPress The Portfolio Homepage

Ed Tansey
Ed Tansey
6,954 Points

Hi, guys, I am bit confused with CPT UI as it has a field 'Post Type Slug', what should I enter for Portfolio?

CPT won't let me use portfolio in the 'Post Type Slug' as I already have a page called that, I am really confused as of what to put. Thanks it advance!

You can put whatever you'd like there, as long as it matches up with any other place you need to use the slug. It is essentially an arbitrary name you create so you can identify it elsewhere. For instance I just used "portfoliopieces" as the slug, but then you have to be mindful to use the slug you create wherever it is used. For instance in my page-portfolio, when I created the $args variable I would write this:

$args = array('post_type' => 'portfoliopieces');

Instead of this:

$args = array('post_type' => 'portfolio');

I hope that makes sense!