Skip Navigation

[Resolved] how to add default option to dropdown filter

This thread is resolved. Here is a description of the problem and solution.

Problem:
how to add default option to dropdown filter

Solution:
you can use the attribute default_label to add the defult option for your filtter.

You can find the proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/split-group-of-filters-with-parameters-on-archive-page-how-to-add-default-option-to-dropdown-filter/#post-1165434

Relevant Documentation:

This support ticket is created 6 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by David 6 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#1165433

Hi Minesh,
That's brilliant. Yes, so simple just to enter the code without the views.
I added a reset button. Can you tell me what I need to do to change my custom view filter so that for wpv-wpcf-county we also have the option "All areas" and that is default?

Thanks.

David

#1165434

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - you can use the attribute default_label to add the defult option for your filtter.

For exmaple:

[wpv-control-postmeta field="wpcf-county" type="select" default_label="All areas" url_param="wpv-wpcf-county"]

Note: I've already added to your site. Please confirm.

#1165442

My issue is resolved now, that's very useful to know about the default_label attribute! Thank you!