Home › Forums › WoodMart support forum › Replace Placeholder Text in Ajax Search
Replace Placeholder Text in Ajax Search
- This topic has 9 replies, 3 voices, and was last updated 5 years, 1 month ago by Elise Noromit.
-
AuthorPosts
-
June 7, 2019 at 12:04 am #127469
EdatParticipantHi Guys
Is there a way to do a string replace in functions.php? I want to replace the placeholder text in the woodmart ajax search form.
<input type="text" class="s" placeholder="Search for products" value="" name="s" autocomplete="off">
I want to change “Search for products” to “Search products”
Thanks
June 7, 2019 at 7:02 am #127502
Elise NoromitMemberHello,
You can replace all theme and plugin texts via PO file in WordPress. Here is a video tutorial that should help you raplace your website texts with a Loco Translate plugin https://www.youtube.com/watch?v=D3NsDdMzsls&list=PLMw6W4rAaOgKKv0oexGHzpWBg1imvrval&index=3
We do not recommend doing in theme files as after update all your customization would reset.
Best Regards
November 1, 2019 at 12:00 pm #154104
InzmanParticipantHello.
I made a child theme and it seems this string is one of the few ones that won’t translate. I have manual PO/MO files. In mobile menu as well as desktop search.
Ideas?
Thanks.November 1, 2019 at 12:39 pm #154120
Elise NoromitMemberHello,
You can rewrite all theme and plugin texts via PO file in WordPress. Here is a video tutorial that should help you rewrite your website texts with a Loco Translate plugin https://www.youtube.com/watch?v=D3NsDdMzsls&list=PLMw6W4rAaOgKKv0oexGHzpWBg1imvrval&index=3
We suggest you to keep translated files in wp-content/languages/themes/woodmart-pt_PT.po folder.
You can delete the plugin as soon as you change the wording.
Best Regards
November 1, 2019 at 12:46 pm #154126
InzmanParticipantThanks for the answer.
I’m using POEdit, I don’t like installing plugins for such a small thing when more reasonable options are available.
Keeping them in “themes/woodmart-child/languages” and all other strings are okay. But not this one…November 1, 2019 at 1:08 pm #154135
Elise NoromitMemberHello,
Changing the pot file is the only way to change the text of the theme or plugin. You can do in code, however, you will have to restore the changes each time after the update.
The theme supports Loco 100%, I cannot guarantee Poedit plugin. Perhaps you can transfer the translation into Loco.
Best Regards
November 1, 2019 at 1:15 pm #154139
InzmanParticipantPOEdit is not a plugin, it is a software to edit POT, PO and generate MO. And that is what a I’m doing with it.
Just saying that all translations work well when I change them, but not this one (Search for products)!
But it seems we have difficulties understanding each other 🙂
PS! I don’t have the need to change main theme files since I’m running a child theme.November 1, 2019 at 6:30 pm #154208
Elise NoromitMemberHello,
Which theme version do you run? I checked in Po edit https://prnt.sc/pr90hw
It seems that you have an outdated woodmart/languages/woodmart.pot file. You need to get it from the latest update.
Best Regards
November 4, 2019 at 1:46 pm #154662
InzmanParticipantYes, it was the version issue.
Thanks.November 4, 2019 at 3:09 pm #154691
Elise NoromitMemberYou are welcome! If you have any questions please feel free to contact us.
Best Regards
-
AuthorPosts
Tagged: String Replace
The topic ‘Replace Placeholder Text in Ajax Search’ is closed to new replies.
- You must be logged in to create new topics. Login / Register