Skip Navigation

[Resolved] How to add Query Filter for wpv-control-postmeta?

This support ticket is created 6 years 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 6 years ago.

Assisted by: Luo Yang.

Author
Posts
#1148978
filter.png

Hi Luo Yang,

The text input filter is not working. Can you help for it?

Please find attached for the image.

1) What is the setting for Query Filter?

2) Besides, below is the code that im using now. Please correct me if im wrong.

Thank you.

[wpv-filter-start hide="false"]
[wpv-filter-controls]

<div class="form-group">
<label>[wpml-string context="wpv-views"]Address[/wpml-string]</label>
[wpv-control-postmeta field="wpcf-address" url_param="wpv-wpcf-address"]
</div>

<div class="form-group">
<label>[wpml-string context="wpv-views"]STATE, AREA[/wpml-string]</label>
[wpv-control-post-taxonomy taxonomy="category" type="select" default_label="SELECT AREA" url_param="wpv-category"]
</div>

[wpv-filter-submit output="bootstrap"]
[wpv-filter-reset output="bootstrap"]

[/wpv-filter-controls]
[wpv-filter-end]

#1148988
Query-Filter.JPG

Hi,

You can try these:
1) Edit the view you mentioned above,
2) Click link "Screen options", enable option "Query Filter", then you will be able to see the section "Query Filter", see screenshot: Query-Filter.JPG
3) and follow our document to setup your custom query filters and search form
https://toolset.com/documentation/user-guides/front-page-filters/

#1149046
filter.png
filter.png

The Text Field still not working. Could you please give a guide for this?

Thank you.

#1149074

I can get your website credentials in your previous post:
https://toolset.com/forums/topic/dropdown-list-not-function-in-responsive-view-handphone-view/#post-1143631

In your case, you can try these:
1) change the filter as below:
- Select items with field:
Area is a string like URL_PARAM(wpv-wpcf-area)

More help:
https://toolset.com/documentation/user-guides/filtering-views-by-custom-fields/
LIKE Single value Checks if the custom field value is similar to the compare value, using MySQL LIKE operator

- Select posts with taxonomy:
Categories slug in one of those set by the URL parameter wpv-category
eg. hidden link

2) And you are using custom codes to filter the query:
hidden link
custom codes: "toolsets1"
It conduct the problem, you will need to select an option in dropdown "STATE, AREA", submit the search form, then you will be able to see the result.

In your case, you can change line 14 of custom codes from:

( isset($_GET['wpv_post_search']) && $_GET['wpv_post_search'] != '' )

To:

( isset($_GET['wpv-wpcf-area']) && $_GET['wpv-wpcf-area'] != '' )

And test again.