Skip Navigation

[Resolved] Filter based on custom value not working

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 9 replies, has 3 voices.

Last updated by kristofG 1 year, 8 months ago.

Assisted by: Minesh.

Author
Posts
#2572571
Screenshot_12.jpg

I am using the HBook plugin for a property listings website and use Toolset to add custom info the that CPT.
One of the custom fields is a Radio so the Admin can select the type of listing (villa, appartment, B&B).
I have created 2 pages with Avada, one with the villa's, and one with the appartments. I use this code to filter the properties, but alle properties show on both pages.

{!{wpv-view name='search' view_display='layout' type='Villa,Vakantiewoning'}!}
{!{wpv-view name='search' view_display='layout' type='Appartement'}!}

hidden link
hidden link

#2572759

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Have you added a Query Filter to your View which takes the value of the "type" shortcode attribute to filter the custom field by?

You are aiming for what is described here: https://toolset.com/documentation/legacy-features/views-plugin/passing-arguments-to-views/

#2572839
Screenshot_13.jpg

Yes, the Query Filter has been in place for several years now and it used to work. It's only now when I visited the clients website I noticed the filtering is gone. I have no idea when the problem occured exactly.
The strange thing is I can no longer edit the filter, see screenshot.

#2573181

Minesh
Supporter

Languages: English (English )

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

That is really strange and we do not see any other users who reported that the filter added is automatically removed.

What if you try to add the related filter again. Delete the existing filter and add all the required query filters again and check.

If you still see that the filters are removed you are welcome to report back the issue and please have close eye on what course of action the issue is happening.

#2573211

As you can see from the screenshot, I cannot edit nor remove the existing query filter.

#2573213

Minesh
Supporter

Languages: English (English )

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

What you can do is from the "Search and pagination" section delete the existing filters and save your view and then refresh the page.

Then try to re-add all required filters from "Search and pagination" section.

#2573241

I have deleted everything from [wpv-filter-start hide="false"] till [wpv-filter-end].
Saved the View. Reloaded the page.
The Query Filter briefly shows the Delete / Edit buttons, but then the Delete button disappears and the [wpv-filter-start hide="false"] till [wpv-filter-end] is back again.

For some reason the Delete button is set to display:none

<button class="button button-secondary button-small js-wpv-filter-remove js-filter-remove js-wpv-filter-remove-custom-field" title="Delete this filter" data-deleteaction="wpv_filter_custom_field_delete" data-nonce="bd63473cd4" style="display: none;">
<i class="icon-trash fa fa-trash">
Delete </button>

#2573257

Minesh
Supporter

Languages: English (English )

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

That is strange. Can you please share URL of your problem view and send me admin access details.

*** 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.

#2573337

Minesh
Supporter

Languages: English (English )

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

I've removed the filter added to the "Search and pagination" section and saved the view and then reload it.

I can see the delete button now: hidden link

#2573615

I have no idea why I could not remove the query, or make the Delete button visible.
It seems the filtering is now working again.