Home › Forums › General Issues › Output Select label, based on page parent ID › Reply To: Output Select label, based on page parent ID
This combination output the label correctly, thanks for the pointers.
<?php
/*
* Displaying a single value's Label
*/
$field = get_field_object('color');
$value = get_field('color');
$label = $field['choices'][ $value ];
?>
Another question on the same issue has raised though. I have a page, with a colorscheme set as described above, also within the page, I have a Repeater Field, which has a sub-field to set a colorscheme.
I’d like to use the same set of color options I’ve set in Options. This works fine if the sub field is named “color”, as this will pick up the choices for a select list. But when these are output, things get confused between the pages colorcheme, and the repeater field box colorscheme – both of which come from a field called “color”.
Is it possible to have a page and a repeater field using the same Options data source for a select list?
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.