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

daveliveseyuk
daveliveseyuk
10,569 Points

Questions on Custom Post Types

Hello all, I've been working on the 'Learn WordPress' track and I'm now working on my own theme. I'm fully comfortable using the custom post type plugins used throughout the tutorial but I'm wondering whether you are able to add more fields to the default post type? Another question I have is about applying categories to custom post types - any help would be appreciated!

2 Answers

Kevin Korte
Kevin Korte
28,109 Points

I'm wondering whether you are able to add more fields to the default post type?

Yep. Just create a new post type, and set the fields to display when the post type is equal to "post"

applying categories to custom post types

If you're using the CPT UI plugin to create your post types, at the bottom of the advanced options, it gives you a checkbox for both categories and tags in the "Built-In Taxonomies" section. Check what you want, and then on the custom post type page, you'll have the same meta boxes like a default post type, and you can use the data in the same way.

Easiest way to do it, or you are putting you post types by hand in the function.php file?

daveliveseyuk
daveliveseyuk
10,569 Points

I'm using the plugins as per the tutorial.

Thanks for the help Kevin!