Skip Navigation

[Resolved] Custom search is behaving strangely…

This support ticket is created 7 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 matthewR-5 7 years ago.

Assisted by: Luo Yang.

Author
Posts
#596947

I am trying to: build a view containing all the custom post types I created with Types, including a filter to narrow the user's search. It all looks fine but when a filter value is changed, either no results are displayed, or only a single post (the same one). Then, when all values on the filter are reset, the same post stays and all others are nowhere to be seen.

I've re-built the view and the filter a few times to check that I wasn't missing something from the code but it's the same problem....

Link to a page where the issue can be seen: page is here - hidden link

I added a reset button temporarily and this takes the view back to displaying all the custom posts, but it doesn't solve the problem with the individual filters....

Please help!

Many thnaks
Matt

#597039

Dear Matt,

I tried the problem URL you mentioned above, but get this error:
403 Forbidden

I suggest you follow our document to setup the custom search form:
https://toolset.com/documentation/user-guides/front-page-filters/

And you can setup the filters one by one, make user the filter is working, then add another one. if you can locate the problem filters, which conduct the problem, please take a screenshot for it, and describe detail steps to duplicate it, I need to duplicate same problem and debug it in my localost.

#597151
Screen Shot 2017-12-08 at 11.36.08.png
Screen Shot 2017-12-08 at 11.36.24.png
Screen Shot 2017-12-08 at 11.36.51.png
Screen Shot 2017-12-08 at 11.37.21.png
Screen Shot 2017-12-08 at 11.37.36.png
Screen Shot 2017-12-08 at 11.39.50.png

Thanks Luo

Not sure why you get a 403 on my link - it is not a restricted page and is fully visible. I thought I had solved this - I rebuilt the view and used manually entered values for the filters, which seemed to do the trick, up until the point that I added a checkbox filter and then everything went wrong as before.

I removed the checkbox filter but the problem persisted. I've changed it to a dropdown select filter, updated permalinks and tried every different permutation for how to page is updated to see if that affects it but it's still not working.

Please help - I need to be able to rely on these filters for the site to work but this has stumped me. The original link to the site I gave above should work for you, but I've included some screenshots and here is the code of the filter editor from the view to see if there's anything obvious I am missing:

[wpv-filter-start hide="false"]
[wpv-filter-controls]
<div class="row ubuntu">
<div class="form-group col-xs-4">
	<label>[wpml-string context="wpv-views"]Property Type:[/wpml-string]</label>
	[wpv-control-postmeta display_values="All,Apartment / Studio,Barn Conversion,Building Plot,Bungalow,Farm or Small Holding,Flat,House,Retirement" values=",Apartment / Studio,Barn Conversion,Building Plot,Bungalow,Farm or Small Holding,Flat,House,Retirement" field="wpcf-property-type" type="select" source="custom" default_label="All" url_param="wpv-wpcf-property-type" style="font-weight:100;font-size:0.8em;"]
</div>
<div class="form-group col-xs-4">
	<label>[wpml-string context="wpv-views"]Property Style:[/wpml-string]</label>
	[wpv-control-postmeta field="wpcf-property-style" type="select" source="custom" url_param="wpv-wpcf-property-style" style="font-weight:100;font-size:0.8em;" values=",Detached,End Terrace,Ground Floor Flat,Semi Detached,Terraced,Upper Floor Flat" display_values="All,Detached,End Terrace,Ground Floor Flat,Semi Detached,Terraced,Upper Floor Flat"]
</div>
<div class="form-group col-xs-4">
	<label>[wpml-string context="wpv-views"]Min. Bedrooms:[/wpml-string]</label>
	[wpv-control-postmeta display_values="All,1,2,3,4,5,6+" values=",1,2,3,4,5,6" field="wpcf-bedrooms" type="select" source="custom" url_param="wpv-wpcf-bedrooms" style="font-weight:100;font-size:0.8em;"]
</div>
</div>
<div class="row ubuntu">
  <div class="form-group col-xs-4">
	<label>[wpml-string context="wpv-views"]Min. Price:[/wpml-string]</label>
	[wpv-control-postmeta display_values="All,50%%COMMA%%000,75%%COMMA%%000,100%%COMMA%%000,125%%COMMA%%000,150%%COMMA%%000,175%%COMMA%%000,200%%COMMA%%000,250%%COMMA%%000,300%%COMMA%%000,350%%COMMA%%000,400%%COMMA%%000,450%%COMMA%%000,500%%COMMA%%000,600%%COMMA%%000,700%%COMMA%%000,800%%COMMA%%000,900%%COMMA%%000,1%%COMMA%%000%%COMMA%%000+" values="0,50000,75000,100000,125000,150000,175000,200000,250000,300000,350000,400000,450000,500000,600000,700000,800000,900000,1000000" field="wpcf-numeric-price" type="select" source="custom" url_param="wpv-wpcf-numeric-price" style="font-weight:100;font-size:0.8em;"]
</div>
  <div class="form-group col-xs-4">
	<label>[wpml-string context="wpv-views"]Max. Price:[/wpml-string]</label>
	[wpv-control-postmeta display_values="All,50%%COMMA%%000,75%%COMMA%%000,100%%COMMA%%000,125%%COMMA%%000,150%%COMMA%%000,175%%COMMA%%000,200%%COMMA%%000,250%%COMMA%%000,300%%COMMA%%000,350%%COMMA%%000,400%%COMMA%%000,450%%COMMA%%000,500%%COMMA%%000,600%%COMMA%%000,700%%COMMA%%000,800%%COMMA%%000,900%%COMMA%%000,1%%COMMA%%000%%COMMA%%000" values="10000000,50000,75000,100000,125000,150000,175000,200000,250000,300000,350000,400000,450000,500000,600000,700000,800000,900000,1000000" field="wpcf-max-price" type="select" source="custom" url_param="wpv-wpcf-max-price" style="font-weight:100;font-size:0.8em;"]
</div>
  <div class="form-group col-xs-4">
    <label>[wpml-string context="wpv-views"]New Build?[/wpml-string]</label>
	[wpv-control-postmeta display_values="All,Just New Homes,No New Homes" values=",YES,NO" field="wpcf-new-home" type="select" source="custom" url_param="wpv-wpcf-new-home" style="font-weight:100;font-size:0.8em;"]
</div>
</div>

<div class="row ubuntu">
  <div class="col-xs-4">[wpv-filter-submit output="bootstrap" style="font-weight:100;font-size:0.8em;padding:10px;width:75%;"]</div>
  <div class="col-xs-4">[wpv-filter-reset output="bootstrap" style="font-weight:100;font-size:0.8em;padding:10px;background-color:#02172a;color:#fff;width:75%;"]</div>
</div>

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

Hi Luo

Don't worry about this anymore - I think I've solved it. For anyone who's having a similar problem, I removed the entry in the filter's value input for the default 'All' display value in all filters and it is now working. So the filters postmeta now look like this:

[wpv-control-postmeta display_values="All,FilterDisplayValue1,FilterDisplayValue2,FilterDisplayValue3" values=",FilterValue1,FilterValue2,FilterValue3" field="wpcf-max-price" type="select" source="custom" url_param="wpv-wpcf-max-price" style="font-weight:100;font-size:0.8em;"]
</div>

So, the first corresponding value is null, just starting with a comma.

Probably not useful to anyone else, bu just in case...

Thanks...