Skip Navigation

[Resolved] Split: Customizing the search bar

This support ticket is created 2 years, 3 months 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/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 2 years, 3 months ago.

Assisted by: Waqar.

Author
Posts
#2271067

Thank you so much for the help!

another concern how can i make a search bar like this?

hidden link

the one with the search by condition field? and magnifying glass icon?

hidden link

and how can i change the name of the search bar?

instead of Conditions it should be

"search by homeopathic remedy" ? thanks!

#2271885

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

There is no built-in feature available to include a search icon in the view's text search field, so it will require some custom code:

1. In the view's "Custom JS" section, you can include the following script to insert the search icon in the field:


jQuery( document ).ready(function() {
	jQuery('<button type="button" class="et_pb_menu__icon et_pb_menu__search-button"></button>').insertAfter('.wpv-filter-form input[name="wpv_post_search"]');
});

2. And to style the search icons show inside the text field, you can include some CSS code in the view's "Custom CSS" field:


.wpv-filter-form .et_pb_menu__icon.et_pb_menu__search-button {
float: right;
position: relative;
margin-top: -58px;
margin-right: -2px;	
}

.wpv-filter-form input[name="wpv_post_search"] {
float: left;
width: 100%;
padding-right: 35px	
}

Screenshot of the Custom CSS and JS fields in the view: hidden link

As for the text "Search by condition" it can be changed through the "Placeholder" field in the search block's settings.
( screenshot: hidden link )

Note: The custom code examples from our forum are shared to get you started in the right direction. You're welcome to adjust them as needed and for more personalized customization assistance, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

regards,
Waqar

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.