I can’t figure out the the code for – How to retain the values from dropdown category lists after wrong form submission? Any suggesstions, thanx in advance.
<select class="selectpicker btn-block" name="coupon_cat" id="category" >
<option selected value=""> Категори Сонгох</option>
<?php
$args['exclude'] = "12,20"; // omit these two categories
$categories = get_categories($args);
foreach($categories as $category) { ?>
<option value="<?php echo $category->term_id;?>"><?php echo $category->name;?>
</option>
<?php } ?</select>