Custom Post Type With Different Views

We are rebuilding our website in WordPress and are trying to figure out the best solution to display a different views of the same product with unique meta data.

For example, let’s say that Property is the post type. We would like to display several different views (completed (built), for sale, and for rent.)

Each would have slightly different text and custom fields that display based on what the user is looking at with 3 different URL patterns:

  • example.com/homes-built/house1
  • example.com/homes-for-sale/house1
  • example.com/homes-for-rent/house1

A Property can fall into one or many different views – (both for sale and for rent for example.)

Ideally, we would have one post type and the views would display the information according to what view you are looking for (rather than duplicate the content and any translations 3 times). I know that this can be achieved with 3 separate custom post types, but is possible to do this with one while maintaining separate meta data for each view?

To complicate things we are using WPML for translation. This is one of the reasons why having one post type would be preferred. Would a plugin like Yoast still be able to apple unique meta data for the separate views?

2 Answers
2

For example, let’s say that Property is the post type. We would like
to display several different views (completed (built), for sale, and
for rent.)

Sure. Just make Completed, For Sale, and For Rent taxonomies for the Property post type.
Look into WP_Rewrite class, too, and you can get greater control over url permalink structure.

Leave a Comment