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 trialAmit Ghosh
1,699 PointsGive more examples where we can use custom post types??
i am not able to understand where to use custom post types in a website construction??
1 Answer
Kevin Korte
28,149 PointsOkay, let's say you were doing a food review website.
You might want to review restaurants, recipes, product reviews, grocery store reviews. Each of these different areas would need different information about them, correct?
So for restaurants, you might want to include extra fields where you could put in the restaurants address, hours, phone number, price, etc. For recipes you might want different fields like ingredients list, location where the recipe is (url?), who's recipe it is, difficulty to make, etc. And so on.
By setting up a custom post type, you can than customize the view you see when you add a new "post". When recipe wouldn't have a phone number (probably, anyway), but a restaurant would. With a custom post type you can show a phone number field on the restaurant custom post type but not the recipe post type.
Does that help?