Trouble retrieving parent post ID from related field
-
I have established a parent-children relationship between two CPT pods; Organizatons (parent), and Locations (children).
Using the sample code as a basis (https://docs.pods.io/tutorials/get-values-from-a-relationship-field/#more-665) for retrieving related field values, my code is failing because it does not retrieve the parent post ID from the $related array even though a var_dump demonstrates that the correct post ID value (465) is actually in the array. Further, as a test, if I hard-code a value of 465 to the $id variable, everything works properly.
So, I suspect that I am a) using the wrong method to retrieve content from a single related parent post, or b) have set up the CPT relationships incorrectly, or c) have a bug in my code, or d) some or all of the above.If there is a preferred alternative method to retrieve parent information based on child information, please point me to it.
- The topic ‘Trouble retrieving parent post ID from related field’ is closed to new replies.