Skip Navigation

[Resolved] Add a search filter to the search form

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

Problem:

Add a search field in the custom search form.

Solution:

You can follow our document to setup the custom search form.

Relevant Documentation:

https://toolset.com/course-lesson/creating-a-custom-search/

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.

Our next available supporter will start replying to tickets in about 7.01 hours from now. Thank you for your understanding.

Tagged: 

This topic contains 7 replies, has 2 voices.

Last updated by maiS 1 month, 1 week ago.

Assigned support staff: Luo Yang.

Author
Posts
#1969971

hi again ,
Is it possible to add a search filter to the search form "Search for badminton camps" where you can choose whether you want camps with sleep over or not? So the search filter could have a title like "sleep over" and then a drop down with "yes" and "no" and then it works as a filter for the camps too?

#1969999

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hello,

Yes, it is possible, you can follow our document to setup the filter in search form:
https://toolset.com/course-lesson/creating-a-custom-search/

Please let me know if you need assistance to for it.

#1971423

Hi,
I already watched this guide and i can not figure out how the "Yes" / "No" option work so it filters the camps after whether there are sleep over or not.

#1971773

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

I have done below modifications in your website:
1) Edit two "camp" posts:
hidden link
hidden link

Setup the field value "Is the camp including a sleep over?"

2) Edit the page:
hidden link
In the search form, add a search field "Is the camp including a sleep over?"

You will need to edit all "camp" posts, setup the field value "Is the camp including a sleep over?"

#1975425

hi Lou,

Thank you so much! I want to edit the view because i want the field "is the camp including a sleepover" to have a little margin so it not too close to the edge of the screen. But when i press "edit view" the search field with sleepover is not showing up? Where is it? 🙂

#1975497

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

grid-margin.JPG

You are using the same view blocks in multiple pages, it conduct the problem you mentioned above.

I have done below modifications in your website:
Edit the problem page:
hidden link
1) find the view block and click "Edit Original" button, reset the search field "Is the camp including a sleep over?"
2) Find and select the grid block, add a margin-left value in it, see my screenshot grid-margin.JPG

For your reference.

#1977247

hi there,
Okay i went into the view and pressed "edit original" and added the search field again. Then i updated the page. Then all the results show up on the same page instead of the result page.

Then i remove the view and add it again and set it to show only search form and then results on another page. Everytime i edit a view i have to update the page, then remove the view, add it again and set it to only show search form on the specific page and search results on another page to make it work.

But i think it works now! Thanks.

#1977249

My issue is resolved now. Thank you!