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! While you're at it, check out some resources Treehouse students have shared here.
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 trialFrancois Dejardin
1,778 PointsExtend default Post Type in relationship to Post Categories
I'd like to extend and specialize the default post type in relationship to its category(ies). So, if i create a new post category (in admin or front) , it'll create automatically the specialized post type and add the related fields and metas... For example, if i add the category "shop" , it will add prices and shipping methods fields to the parent post fields ... If i add the sub category "clothes" to the category "shop", it will get the parent "shop" custom category fields and add some new specialized fields.
I know i can just create custom post types for all categories in order to make this, but i'd like to automate this and also i'd like to keep only one categories hierarchy in order to filter all this easier.
I don't know if i'm clear, but it looks like the base Object Oriented perspective and i don't see exactly how i can figure out this with wordpress...
Thanks a lot !
François
1 Answer
Francois Dejardin
1,778 PointsHi all !
Finally, i think i've found what i need just by creating a custom post type with different taxonomies and terms that give me the ability to extend the base functionalities of the root post.
I think i complicated the process when wanting to implement each functionality in different custom post type ...
Just have to find solutions to create a good way to make relationships between taxonomies and terms, have to work hard for that !
François