Archived topic
gpp 2.0 custom post type's meta fields as block in another posts - pages
5 replies · Started by Carlo on April 13, 2021
Hi,
I am not sure I am in the right direction...
Let's say I have some pages/posts. Each page/post is a movie.
For each movie there is a director.
Each director can "belong" to more than one movie.
Each director has some info elements:
- featured image
- name
- a single row "title"
- a description (bio info)
I am looking for the best way to show, in each movie (page/post), its director's info elements.
And in case I needed to edit those infos, doing it just once in a "sinlge place" and not for each page/post movie directed by that director...
So far, I have created a reusable block for each director and put the relative reusable block in each page/post. So if I need to edit a director's info, I just edit the reusable block.
But I'd like to improve the solution in a more "automatic" way and not being stuck with the "style / structure" of each block.
Infact, if I want to edit the style / structure how the director's infos are shown, I need to edit each director's reusable block.
I don't know if it is possible with a mix of some gpp block, hooks, dynamic fields, custom fields and maybe a custom post type. :D
So far I have
- created a custom post type "director"
- assigned each director's custom post type a featured image
- created some custom fields (single row title, description) belonging only to that custom post type
For each movie, how can I
- "link" that movie to a director
- show the specific director's infos?
Does it make any difference if I use pages or posts for the movies?
Thank you. Best wishes
Hi there,
There are a few things to consider:
We'll have to think how this is structured. Based on your explanation it seems like you want to create a post type for "Movie" and then associate your "Director" post type to it. You'll need to set relationships between these things.
There's a plugin for that. Check Posts 2 Posts. I think it fits what you need. :) https://wordpress.org/plugins/posts-to-posts/
Hi Elvin,
I'd prefer to avoid no longer supported plugin. Thank you for helping me better understand what I need.
Hi there,
check out Pods.io:
It's probably the best plugin for creating post / archive relationships.
Thank you David, I'll check it out
You're welcome