I just upgraded to ACF to 4.2.1, and now the Relationship Fields that I had been using show no data. The data is in the database, but it is not showing up on either the admin screen for the post, nor the the public-facing page.
I reverted to an older version of ACF from another site (back to version 188.8.131.52), and now the admin side and my public pages work fine.
On the admin page for a post, I could see the left side of the panel for the Relationship Field, but nothing showed up on right side. And I could not add anything to the right side.
(BTW, I also upgraded to WP 3.6 at the same time, so maybe there’s something rotten in Denmark with WP 3.6 and Relationship Fields in ACF 4.2.1.)
My site (now working with the older version of the plugin) is here:
http://andersenhomedepot.com/series/200-series-windows-doors/ — then click to a colors & options tab on this page. Each thumbnail is it’s own post (custom post type), and is related via ACF’s Relationship Field.
Confirmed that 4.2.0 works. Just tried that, and it works fine. So I took a look at the changelog, and it says “Relationship Field: Add new option for return_format”. So I played around with that option on the admin screen, thinking that maybe I just needed to re-save the field type. No joy.
I’m 99% sure that the issue is due to ACF not loading the selected values based on an issue with the post_type parameter to the WP_Query function
Your data will only be lost if you update a page which had selections on it. I will fix a fix for this today.
I downloaded and installed the latest “acf-master” from Github. Works fine for me now. Admin fields work properly, and the public display pages are showing the relationships, too.
(P.S. I’ve only installed this on a development copy of the site, not on the live site yet. I’ll wait for the official dot-release.)
After a year I have suddenly the same isse with version 4.3.8.
When I add a item to the relations shows up with the correct post_type but when I save the post, the post type changes to the (wrong) post_type of the current post I’m editing (see attachment).
In frontend the get_field() shows results only if I set the option “return post IDs” and not if I set “return post Objects”.
thanks for the code, that is really help me a lot, but still i got a issue in this code, when i add relationship field from admin side then if i select in the only 2 Post From My CPT , then still it displayed all. i just want display only which is i selected from admin side
please help me if you can????
The topic ‘Relationship Field not displaying data’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.