Home › Forums › ACF PRO › How to get the number of posts from Relationship field? › Reply To: How to get the number of posts from Relationship field?
Hi @jonathan
It’s work correctly in the case, when I need to get from Relationship field the number of posts – of custom post type “movies”: – given that on the page of edit/creation new post of custom post type “movies” i have this relationship field “movies_of_this_producer”. And in this relationship field “movies_of_this_producer” i can choose a corresponding “producer” post.
But if i need to get (from Relationship field) the number of posts – of custom post type “producers”: – it’s work incorrectly.
*Posts of custom post type “producers” – have the “reverse” relationship with posts of custom post type “movies” via relationship field “movies_of_this_producer”.
I created a new topic with a detailed description of this problem and with my code examples: http://support.advancedcustomfields.com/forums/topic/how-to-get-the-number-of-posts-from-relationship-field-for-reverse-posts/
Tell me please, what code should be used in case with posts, that have “reverse” relationship?
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.