Default ad type.
-
Hello.
I have 3 types of ads on my website: Cars, trucks, all_auto.
On the ad form page, I need to select the default ad type as “all_auto”. how can I do this?
So that users do not have to select this item every time.
What needs to be changed in this code so that the ad type is “all_auto” by default?
<div class="form-group row"> <label for="rtcl-category" class="col-md-2 col-form-label"><?php esc_html_e( 'Ad Type', 'clcar' ); ?> <span class="require-star">*</span> </label> <div class="col-md-10"> <select class="rtcl-select2 form-control" id="rtcl-ad-type" name="type" required> <option value=""><?php esc_html_e( "--Select a type--", "clcar" ) ?></option> <?php $types = Functions::get_listing_types(); if ( ! empty( $types ) ): foreach ( $types as $type_id => $type ): $tSlt = $type_id == $selected_type ? ' selected' : ''; echo "<option value='{$type_id}'{$tSlt}>" . esc_html( $type ) . "</option>"; endforeach; endif; ?> </select> </div> </div>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.