• Resolved kemmieg

    (@kemmieg)


    I have two custom post types one is Sessions and the other is Presentations. I have an ACF relationship field named relationship on both post types but they are different. On the sessions field it’s getting the names of the presentations post type and on the presentations field it’s getting the names of the session post type.

    I was assuming when I added the session to the presentation post it would show the presentation selected in the session, is this not how it works?

    Was there anything other than that I needed to do? i.e. any other coding needed to get this to work this way?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author John Huebner

    (@hube2)

    Somewhere in your description of the problem you lost me.

    Is the field name the same on both post types? What is the field name(s)?

    Are the field at the top level, not a sub field of a group, repeater or anything else that allows sub fields?

    Thread Starter kemmieg

    (@kemmieg)

    I figured it out. I didn’t have the code in my functions.php file that is on Github. It’s now working properly. It doesn’t say anything in the plugin directions about this snippet I happened to find it on ACF website.

    Love the plugin now that I figured out what I needed to do. Works perfectly.

    Thank you

    Plugin Author John Huebner

    (@hube2)

    Snippet?

    Thread Starter kemmieg

    (@kemmieg)

    Plugin Author John Huebner

    (@hube2)

    That is an example of how to do this without this plugin. If you’re using that code then this plugin is not required.

    Thread Starter kemmieg

    (@kemmieg)

    Well it wasn’t working until I put that code in. Once I added the field keys it started working properly. Before that the relationship field wasn’t updating on the two post types and after I added it, it started working.

    Plugin Author John Huebner

    (@hube2)

    If this plugin was not working then there was something wrong with the setup of your fields. Either the field names were not the same or the fields were not at the top level.

    The code uses field keys, which negates the need to have the fields named the same.

    Thread Starter kemmieg

    (@kemmieg)

    Both fields were top level and named exactly the same. That was why I couldn’t figure out what was wrong with it. It wasn’t working until I added the code to the functions.php file then it started working great.

    Maybe something was in conflict with the plugin, I don’t know but I went through the instructions at least 10 times to make sure I wasn’t missing anything and it just wasn’t working.

    Plugin Author John Huebner

    (@hube2)

    I just did a quick test of the plugin and everything is working as expected.

    If you want you export your fields to PHP and post them in an issue over the github repo for this plugin and I can look at it to see if I see anything that would stop it from working.

    Other than this I would suggest deactivating other plugins and testing on a different theme to see if there is a conflict somewhere else. If you can narrow this down I might be able to find a way to correct it.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Not sure about the ACF Field’ is closed to new replies.