I have 2 custom post types,
person. Both have several custom fields.
I'm working on a template for the
project custom post type.
project custom fields I have several fields of type relation, as seen in this screenshot. Unfortunately I don't really undestand what they mean and how to use them, but that is not my main question.
Next, inside the
person custom fields, I have only text fields, like
Now let's say I have one custom post type of type
person. That person has contributed to a project, which is a custom post type of type
How can I now, when working on the template of the
project posts, include an [acf field] shortcode to a custom field of type
I'm fairly new to wordpress and have no knowledge in php
Ideally a solution to my problem should not need me to add code to php files as that is not desired by my client. Preferably it should be doable inside the WPBakery template editor.
- Installed and usable plugins are ACF, WPBakery, toolset, salient, acf-vc, custom post type UI
Thank you for your help, I hope I succeeded to phrase my problem in an understandable manner.
I found this plugin, which seems to do provide one solution: nested shortcodes: https://wordpress.org/plugins/nested-shortcodes/
Unfortunately, it also poses constraints, and has not allowed me to find a solution. What I want to do is this:
[acf field="first_name" post_id=[acf field="student"]]
With the expected output being:
Unfortunately the output I get is:
Which according to them is partly due to shortcode limitations listed here https://codex.wordpress.org/Shortcode_API#Limitations
On the other hand, this hardcoded workaround works:
[acf field="student"] Output:
[acf field="first_name" post_id=89] Output:
Unfortunately this workaround has the hardcoded unique ID 89, which makes it thus unable to use as a template for future usage.
Does anyone have a solution or better workaround that does not necessite me to hardcode? I'm also open for completely new ideas and directions, as long as it helps me solve this problem