WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I currently have a custom post type setup for the different buildings that a Real Estate developer owns. Each building can have multiple images, a short description and a few different fields setup in a custom metabox.

I would like to allow my client to add available space listings for each property, and I'm stuck on the best way to integrate listings with the buildings. The available space listing would require a few fields including square footage, price and an image.

I've though about creating a listings taxonomy and even a custom post type for them, but the listings are really a 1-n relationship with the buildings, so neither is an ideal solution.

A custom metabox in the building post type seems like it would work, but it would somehow require a way to create multiple instances of the same metabox.

Does anyone have any ideas or suggestions?

share|improve this question
I think I found what I'm looking for: wordpress.stackexchange.com/questions/25478/… – Dan Oct 5 '11 at 19:11

I think perhaps an Available Space Custom Post Type, along with custom post metadata for the Available Space CPT, to correlate each Available Space CPT with its appropriate Building CPT, is the way to go here.

A one-to-one relationship would lend itself well to custom post metadata in the Building CPT itself, but the one-to-many relationship really implies that you should go the CPT route.

share|improve this answer
I've considered going the CPT route with the listings as well, but the many-to-many relation that would create would probably become cumbersome. Each available space listing is only directly related to a single building, so displaying them all together would get confusing when editing/deleting listings. – Dan Oct 5 '11 at 18:23
Where would the many-to-many relationship come from, if each "Available Space" CPT had post custom metadata that tied it to a specific "Building" CPT? – Chip Bennett Oct 5 '11 at 18:31
I was thinking it would be confusing on the administration side. I guess if I can sort the "Available Space" CPTs by a custom metakey, it might work. – Dan Oct 5 '11 at 18:44

Similar to @Chips suggestion above, I would create a custom post type for "Available Space" with meta boxes for the space listing details.

However, I would create a custom taxonomy for the various "Building" types. The taxonomy would allow you to easily group or sort the "Available Space" posts by the "Building".

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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