Welcome to the Treehouse Community
Looking to learn something new?
Paul Neumyer15,301 Points
Custom Post Types for WP Themes and Redistribution
Hey Zac Gordon ,
I have taken your courses on creating WP Themes, and I love what you are doing. However I was wondering, without using a plugin to create custom post types, would it be possible to create custom post types inside of a theme. For example, what steps would you take if you were creating a theme for redistribution, on sites like ThemeForest? Any input you provide would be helpful. Thank you.
Zac GordonTreehouse Guest Teacher
You can but it's not recommended because if someone changes their theme they loose all the custom content.
The right way is to require a custom field plugin to be installed along with the theme and then include the code in your theme to make sure the right custom post types exist and if not set them up with the plugin programmatically.
You should be able to search around and figure this out or look at how other themes tackle it. I'm going to cover this in an advanced WP theme course, but it won't be out for a while.