Hi there,
We have a 'Team' CPT and a custom field (a select field) created with ACF Pro (screenshot attached). The select field list the alphabets (all 26 letters).
I have created a View and added a filter using that custom select field. I am displaying those in checkboxes (screenshot attached), but it's not displaying all the 26 letters. It's just displaying the 2 letters that were used. Is there a way to display the letters that are not used? We just want to display all 26 characters.
Please find a test page of the view below:
hidden link
Thank you!
Hello,
I assume you are using classic editor to setup the post view, please edit it (ID: 2782), in section "Custom Search Settings", enable options: Let me choose individual settings manually-> Always show all values for inputs
And test again
Thank you Luo!
I did that already and it's still not displaying all the alphabet letters (screenshot attached).
Is there anything else I am missing?
Since you are using other plugins(ACF Pro) to setup the custom select field "alphabets", but Views can not load the field settings from plugins(ACF Pro) , so it conducts the problem you mentioned above, you can use Toolset Types plugin to setup the custom field "alphabets", and test again
Thank you Luo!
I did re-create the select field using the Toolset Custom fields (screenshot attached), but it's still not display the 26 letters (checkboxes) on the frontend (hidden link).
In the 'Letter' select field, I did not add in all the 26 letters manually, but use this code to generate the 26 letters:
add_filter( 'wpt_field_options', 'add_some_options', 10, 3);
function add_some_options( $options, $title, $type ){
switch( $title ){
case 'Letter Select':
$alphabet =[];
foreach (range('a', 'z') as $char) {
array_push($alphabet,$char);
}
$options[] = array(
'#value' => 0,
'#title' => "Select",
);
foreach ($alphabet as $letter ) {
$options[] = array(
'#value' => $letter,
'#title' => strtoupper($letter),
);
}
break;
}
return $options;
}
Also, please find screenshots of my toolset view settings.
Is it because I did not add the option values manually in the select field, it's not displaying it on the front-end?
Thanks!
Yes, you need to add the option values in the select field manually, and test again.
Thank you Luo!
So there isn't a way to list all of the letters on the front-end, unless I add the option values in the select field manually?
Yes, you are right, you need to edit that custom select field "Letter Select" settings:
add the option values in the select field manually(a~z)