-1

In an upcoming WordPress project I have to display a listing of offices, and these offices would have a bunch of user fillable fields.

I have spent some time thinking about the anatomy of an office and decided it would have the following:

Things that make up an office (in my scenario):

  • Name
  • Address line 1
  • Address line 2
  • City
  • Street
  • Postcode
  • Is opening soon?
  • Opening date?
  • Latitude
  • Longlitude
  • Summary/ short description
  • Price per day currency
  • key points - access, parking, cafe, other assets
  • Contact phone number
  • Contact email
  • Description of location/ centre
  • Key features and benefits
  • Photo of tour guide for office or centre
  • Directions by tube/ train, bus, driving etc
  • Reviews
  • Photography
  • Given name
  • legal name

I'm fairly new to WordPress but from the list I have given, would an office qualify as a custom post type, or is the leaning more towards a plugin or custom tables?

I feel like things like key features would themselves be a taxonomy type much like the use of tags. For instance an office could have stuff like:

  • Parking
  • Wi-Fi
  • Vending machine

I'm just a bit hazy about what counts as what.

1
  • Hi. You should consider rephrasing your question. As it stands now, it's off topic.
    – Howard E
    Feb 17, 2020 at 13:07

2 Answers 2

1

How you store your data has nothing to do with whether it is add/edited/removed from a plugin or your (child) theme's functions.php file. So I'd say that your question is whether to add a custom post type or use a custom table for you 'office' entity.

You being new to WordPress, I'd advise you to go with custom post types. And use some plugin to create and manage it (like Pods or Custom Post Type UI). You can start off testing and making changes visually, which I think will be very convenient in your case. Then you can opt to implementing it with your own code.

Those plugins also allow you to add custom taxonomies for your added custom post types, so you should be good to go.

1

It sounds like your question is more around how to save all the custom data points, rather than around post types.

Yes, when you have a content type where you're planning to add a lot of custom data outside of regular post_content, a custom post type does often make sense. That's because this allows you to easily set up a single-posttype.php template in your theme which will handle all the output of the other data.

As to how and where to save the custom data, you might actually do better to build custom Blocks to hold each data point, and you can then set up a CPT template that forces each one to have all that data in that order, if you like.

However, if you plan to do any querying based on the extra data, custom taxonomies would serve you much better. It is difficult (at best) to query for specific blocks in post content; it is difficult (at best) to query for data you've saved in other tables; and your other option - saving the custom data as postmeta - makes for very slow queries. So if you ever plan to have search or filtering options to find an office by any of its data like parking, wi-fi, etc., your best bet would be to set up Office as a CPT, and also set up custom taxonomies associated to that CPT.

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