M
M
Marco772015-12-03 01:41:15
Bootstrap
Marco77, 2015-12-03 01:41:15

How to change search dropdown to checkbox?

Tell me how to change the drop-down search so that it becomes a horizontal checkbox in a row

<div class="row">
                    <div class="col-md-3 col-sm-3">
                        <div class="form-group">
                            <label for="search_type"><?php _e('TYPE:',CMS_NAME); ?></label>
                            <?php
              $args = array(
                                                'show_option_none' => 'ALL',
                                                'name'             => 'search_type',
                                                'taxonomy'         => 'property-type',
                                                'hide_empty'       => false,
                                                'orderby'          => 'name',
                                                'order'            => 'ASC',
                                                );
                                            ?>
                                            <?php wp_dropdown_categories($args);?>
                        </div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Abramovich, 2015-12-10
@Marco77

Use another function and wrap it in the appropriate input, something like this

$categories = get_categories( $args );
 foreach ($categories as $category) {
  $option = <input type="checkbox" name="option1" value="a1" checked>';
  $option .= $category->cat_name;
  echo $option;
  }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question