Skip Navigation

[Resolved] Hide and show search items in search bar

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

Last updated by Minesh 1 year, 2 months ago.

Assisted by: Minesh.

Author
Posts
#2779985

Dear support,

I want to ask if there is any way to create a button in search bar in order to show and hide some elements. I don't want all my search fields to be visible. I need a "more" button in order to hide some items.

Kind regards

#2779996

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Do you mean you have custom search view where you have added many search filters and out of those you only want to show some and add some fields to toggle button so when toggle button active those custom search fields should show otherwise not.

#2780020

Hi Minesh.

Yes ! This is my request! I want this toggle button, to hide some search fields in order to make my search bar a little more compact, because I want to put it in my homepage.

Here is the link from my search view
hidden link

#2780097

Minesh
Supporter

Languages: English (English )

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

ok. Thank you for confirmation but there is no native feature to toggle the search fields.

However, you can achieve this by adding some custom JS code and some adjustment with classes or HTML.

Please check the following links that might help you:
- hidden link
- hidden link
- hidden link

More info:
- https://toolset.com/course-lesson/adding-custom-javascript-to-views-templates-and-archives/
- https://toolset.com/course-lesson/adding-custom-css-to-templates-archives-and-views/