Thank you very much for your detailed answer.
But for some reason something is not working.
I added the code you posted in functions.php
file
I added the class name acf-need-to-add-all-option
to the field at the acf field management.
This is the code I retrieve the field options to the search form at the front end and where I want to add all the ‘select all’ option.
<div>
<label for="field_59ae96d970a06">Select a city</label>
<?php
$field_key = "field_59ae96d970a06";
$field = get_field_object($field_key);
if( $field )
{
echo '<select name="' . $field['key'] . '">';
foreach( $field['choices'] as $k => $v )
{
echo '<option value="' . $k . '">' . $v . '</option>';
}
echo '</select>';
}
?>
</div>
To be honest I am sure that I am doing something wrong.
*** The code you wrote above adds the All
option to the backend edit field section.
How can I add it to the front end?
Thank you again.
Thank you for you fast answer.
the field was empty…
shame on me…
Thank you very much!
Unfortunatley its not working.
<?php the_field('upper_front_cube_title_1', 'option'); ?>
is still not showing results…
this is a screenshot of my acf ui.
Mybe I didnt explainf myself well.
http://nimb.ws/GXPwpV