Skip Navigation

[Closed] Placeholder in custom search input text

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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

This topic contains 5 replies, has 3 voices.

Last updated by Mateus Getulio 1 year, 1 month ago.

Assisted by: Mateus Getulio.

Author
Posts
#2649207

Hello. I'm trying to get a placeholder in input text of custom search. I have seen that there is an opction to get a label up, down, after or before, but I need to get a text inside of input text of custom search that shows... search by address

#2649263

Nigel
Supporter

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

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

You want to replace the placeholder text "Enter a location" in the filter input for the centre of the search radius?

It's not possible within the UI, and checking through the code it doesn't appear readily customisable.

I'd say you have 2 options. One is to simply add a little JS to the page which updates the placeholder attribute of the select input with the required text. (The input has an ID of "toolset-maps-distance-center" which you can use to target the correct element.)

Alternatively this is how the string is registered in the code base:

$enter_a_location_translated = esc_attr( __( 'Enter a location', 'toolset-maps' ) );

So you could use the gettext hook to filter the string, or—better—the modified hook to target the toolset-maps text domain, i.e. gettext_toolset-maps:

https://developer.wordpress.org/reference/hooks/gettext_domain/

#2649367
Captura de pantalla 2023-10-02 a las 17.49.26.jpg

Hello Nigel.

Not in enter location. I need to get a placeholder in the input text field. I attach an screenshot.

Thanks in advanced.

#2649927

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hey there,

Thank you for contacting our support.

Can you please try too add the custom jQuery code to try to achieve the desire result?

jQuery(document).ready(function(){
  $("input[name='wpv_post_search']").attr('placeholder',' add your place holder text');
});

For further reference, please check: https://toolset.com/course-lesson/adding-custom-javascript-to-views-templates-and-archives/

Thank you, please let us know how it goes.

Mateus

#2650035

Hello. First of all thnk for your help.
It doesn't work. Added in js box without any result.

#2650191

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

I would like to request temporary access (wp-admin and FTP) to your site to take better look at the issue. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Our Debugging Procedures

I will be checking various settings in the backend to see if the issue can be resolved. Although I won't be making changes that affect the live site, it is still good practice to backup the site before providing us access. In the event that we do need to debug the site further, I will duplicate the site and work in a separate, local development environment to avoid affecting the live site.

Privacy and Security Policy

We have strict policies regarding privacy and access to your information. Please see:
https://toolset.com/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

**IMPORTANT**

- Please make a backup of site files and database before providing us access.
- If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this: hidden link

Please, let me know if you need any additional details. Have a nice day.

The topic ‘[Closed] Placeholder in custom search input text’ is closed to new replies.