Home › Forums › ACF PRO › Different values for same field groups on different options pages? › Reply To: Different values for same field groups on different options pages?
Hmm,
Okay, adding 'post_id' => 'options2_featured_posts'
successfully separates things in the backend…
// Support showcase Features for this post type, via ACF
if( function_exists('acf_add_options_page') ) {
// add sub page
acf_add_options_sub_page(array(
'page_title' => 'Articles Features',
'menu_title' => 'Articles Features',
'menu_slug' => 'articles-features',
'capability' => 'edit_posts',
'parent_slug' => 'edit.php?post_type=article',
'position' => false,
'icon_url' => false,
'post_id' => 'options2_featured_posts'
));
}
But what does this mean for how I should call/display the resulting data?
So far, I have used a common template part, “showcase”, to serve up the features in a consistent layout, including…
// Must get IDs from ACF options page...
$featured_posts = get_field('featured_posts', 'option');
… as seen in the docs.
How should that change to reflect options2_featured_posts
?
Do I perhaps have an issue using an underscore in the original field name?
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.