0

I want to structure my site like such:

http://www.website.com/cars/
http://www.website.com/cars/blue/
http://www.website.com/cars/red/

Where both /cars/ and /blue/ would be articles that can receive comments. If you went to cars/ you would be able to display a listing of all of the children so you could click through to /blue/ and /red/ etc. I also want users to be able to comment on every page of the site.

How can I accomplish this with wordpress? I can't do it with categories and posts because I need content and comments open on the parent. I would prefer the children to be posts as opposed to pages as the site is already setup to use this structure.

2 Answers 2

0

I would suggest a combination of using pages for the parent directory content and comments handling e.g with the slug/cars-home/ and a custom post type to gather each single cars e.g. /cars/red/.

-- /cars/red/ (single CPT)
-- /cars/blue/ (single CPT)
-- /cars/white/ (single CPT)

--/cars-home/ (page)

Next you can either add a custom loop to include a loop querying the car Custom Post Type, or you can call the cars-home page inside your car CPT archive template.

0

You're making a bit of a mistake in your thinking.

WordPress doesn't store posts in folders; all posts get stored in the wp_posts table in your database. Any organization of the posts go in entries in that table (and then how they work is controlled by a more complex assignment of relationships between the wp_posts and the wp_postmeta table).

Or are you asking about where to store images and other media? If you want that the easiest way to pull it off is by referring to them via URL in your posts instead of using the WordPress media library.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.