Home Forums Front-end Issues adding select menu to front end form


adding select menu to front end form

  • hello,

    I am creating a search form in my theme. In this form I want a select menu that uses the choices from the custom field I created (see attached for custom field)

    I would also like to do this with checkboxes for another custom field.

      $field = get_field_object('field_XXXXXXXX'); // field key of your field
      if (!empty($field['choices'])) {
          <select name="your-field-name">
              foreach ($field['choices'] as $v => $l) {
                ?><option value="<?php echo $v; ?>><?php echo $l; ?></option?<?php 
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.