Support

Account

Home Forums General Issues Relationships between custom posts and meta data

Solved

Relationships between custom posts and meta data

  • Hi there,

    I’m looking for some input/feedback/criticism on a sort of stream of consciousness I have going right now:

    I have a custom post type: “Organizations”. I made some custom fields for it like mission statement, logo, address, etc. Some of these organizations have “children organizations”, like a local chapter or post of the American Legion for example.

    I’m thinking of including a custom field denoting whether or not said organization is a parent or child organization, and if it is a child, then you select it’s parent. That seems fairly straight-forward, however…

    On the single page for a child organization, how would I—or would I be able to—include the name or the logo of the parent organization?

    It would be pretty straight-forward in an MVC setting like CakePHP or Ruby on Rails, but I don’t really understand how to do something like this in WordPress with ACF.

    Any tips would be much appreciated… thank you!

  • I wouldn’t use ACF. This is something that is built into WP. I would set up my post type as hierarchical and support 'page-attributes' Then when creating a new post you just select the parent post. The it is a fairly simple to get the pages parent post and get the custom fields from it.

    I would also create different fields for parent and child paged if I did not want the client to put a logo on a child page.

  • Thank you so much!

    I knew I was going about it wrong in some sort of fashion 🙂

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Relationships between custom posts and meta data’ is closed to new replies.