Hey @stephcerratti
I managed to figure out what this issue is ??
Essentially, the ACF shortcode doesn’t behave as expected when using it.
I tried the exact same shortcode (with a relationship field) in a reglar WP post, and it threw the same error… so that’s good to know the issue is not in our plugin.
It turns out the problem with relationship fields is there is not necessarily one way to display them (so I don’t think ACF has a default way to display the field)…
At least in my testing this was giving me the same issue.
Anway, I decided to make a new shortcode, which adds a simple display of relationship fields. You can find that here:
https://gist.github.com/rmorse/22982fe907988359bd10ace36ce790bf#file-acf-relationship-field-shortcode-php
You first need to copy that to your themes functions.php file (it should be in your child theme).
The way to use this is like this:
https://snipboard.io/rmsgER.jpg
[ca_acf_relationship_field field="field_name"]
If you want to customise how this looks, you’ll have to modify the first code snippet I provided (the github link).
Give that a spin and let me know if it works out for you?
Best
– Ross
-
This reply was modified 3 years, 4 months ago by
Code Amp.