Hi, you can do this by adding following code in your theme functions.php
add_filter( "adverts_form_load", "my_adverts_form_single_category" );
function my_adverts_form_single_category( $form ) {
if($form["name"] != "advert") {
return $form;
}
foreach($form["field"] as $k => $field) {
if($field["name"] == "advert_category") {
$field["max_choices"] = 1;
$field["empty_option"] = 1;
$field["empty_option_text"] = "Select Options ...";
$field["empty_options_text"] = "Select Options ..."; // twice due to bug in 1.0.2
$form["field"][$k] = $field;
}
}
return $form;
}
This will change the field into single single-select dropdown.
Thanks Greg – your support is simply brilliant (and very, very much appreciated)!! 🙂
Hello
Is Possible Make Category Selection in Multilevel Seletction
1st Dropdown of Category
2nd Dropdown of Sub Category.
Many thanks.
Arun Kumar
https://wordpress.org/plugins/wpadverts/
Hi,
actually, WPAdverts allows selecting multiple categories when posting an Ad by default?
Yes i Know it…..But i want it in 2 Level….1st select Main Category Then Sub-Category.
Multilevel Dependent Dropdown Like that…..please help.
http://www.jqueryscript.net/demo/Multilevel-Dependent-Dropdown-Plugin-With-jQuery-Dependent-Dropdowns/
Displaying categories like that is not really possible i am afraid, at least not without a lot of custom programming.