Skip Navigation

[Resolved] Customize my search filter that displays my CPT & Custom fields.

This support ticket is created 4 years, 7 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 4 replies, has 2 voices.

Last updated by sheaN 4 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#1877401

Tell us what you are trying to do?

Hello, my dropdown filters are not working correctly on my archive page, I am trying to fix a couple of filters. A couple of filters need an "all" option (player ranking, grad year).

The filters are straight html, and I'm trying to edit these to add an "all" option, the filters also do not seem to filter correctly.

Is there any documentation that you are following?

Here is the filter HTML of the two:
<div class="wp-block-toolset-views-custom-search-filter wpv-custom-search-filter wpv-custom-search-filter-label-top" data-toolset-views-custom-search-filter="1"><div><div class="form-group"><label class="wpv-custom-search-filter__label" for="wpcf-player-ranking">[wpml-string context="wpv-views"]Player Ranking[/wpml-string]</label><!-- ## --><span class="wpv-custom-search-filter__input">[wpv-control-postmeta type='select' value_type='NUMERIC' order='descnum' source='custom' values='5,4,3,2,1' display_values='5,4,3,2,1' field='wpcf-player-ranking' url_param='wpv-wpcf-player-ranking']</span></div></div></div>

<div class="wp-block-toolset-views-custom-search-filter wpv-custom-search-filter wpv-custom-search-filter-label-top" data-toolset-views-custom-search-filter="1"><div><div class="form-group"><label class="wpv-custom-search-filter__label" for="wpcf-grad-year">[wpml-string context="wpv-views"]Grad Year[/wpml-string]</label><!-- ## --><span class="wpv-custom-search-filter__input">[wpv-control-postmeta type='select' field='wpcf-grad-year' url_param='wpv-wpcf-grad-year']</span></div></div></div>

What is the link to your site?
hidden link

#1878147

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

It seems you created the custom search using Toolset Blocks and you want to add the default option ALL to your custom search frontend filter field (player ranking, grad year).

If this is correct, it seems it will require to add hook wpv_filter_query using which we can modify the filter arguments on fly.

If you can share temporary admin access details I will try to play with it and check what we can do in this case.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1878715

Hi Minesh,

Just bumping this to see if you've been able to look at the site? Thanks again for your help.

#1879143

Minesh
Supporter

Languages: English (English )

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

Thank you for sharing access details.

I see you are using Toolset Blocks then whey you added the filter with div like this?

<div class="wp-block-toolset-views-custom-search-filter wpv-custom-search-filter wpv-custom-search-filter-label-top" data-toolset-views-custom-search-filter="1"><div><div class="form-group"><label class="wpv-custom-search-filter__label" for="wpcf-player-ranking">[wpml-string context="wpv-views"]Player Ranking[/wpml-string]</label><!-- ## --><span class="wpv-custom-search-filter__input">[wpv-control-postmeta type='select' value_type='NUMERIC' order='descnum' source='custom' values='5,4,3,2,1' display_values='5,4,3,2,1' field='wpcf-player-ranking' url_param='wpv-wpcf-player-ranking']</span></div></div></div>

Normally, when you build the view using Block, you should add the search filter using the button "Add Search Field". Please check the following Doc for more info about how you can build the custom search:
- https://toolset.com/course-lesson/creating-a-custom-search/

I've added the "All" option for the field Player Ranking s given under:

[wpv-control-postmeta type='select' value_type='NUMERIC' order='descnum' source='custom' values=',5,4,3,2,1' display_values='All,5,4,3,2,1' field='wpcf-player-ranking' url_param='wpv-wpcf-player-ranking']

And for the Grand Year, as given under:

[wpv-control-postmeta type='select' field='wpcf-grad-year'  
default_label='All' url_param='wpv-wpcf-grad-year']
#1879735

Looks like the filters are working properly, thank you again for your help.