Home › Forums › General Issues › Same Relationship field for multiple Post Options sub-pages? › Reply To: Same Relationship field for multiple Post Options sub-pages?
As @hube2 points out in the other linked thread, the method to use is…
In the acf_add_options_sub_page
declaration, add 'post_id' => 'article'
as a parameter.
This is how the field data, as entered on the Options page corresponding to my post type, will be saved.
On the display end, display using $featured_posts = get_field('featured_posts', 'article');
‘article’ and ‘report’ are both used.
In my case, at the display end, I use $queried_object->name
to dynamically infer either ‘article’ or ‘report’ post types.
Thanks.
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.