Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › transposh
This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko 3 years, 10 months ago.
- AuthorPosts
- November 16, 2020 at 12:35 pm #30297
is there a way to solve my problem with transposh, search result are allways in the default language.
November 16, 2020 at 1:09 pm #30299Hi,
Well, unfortunately transposh is not supported officially, but I recall we were able to suggest a custom code in a previous ticket, that worked with some results.
Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
Best,add_action('asl_layout_in_form', 'aslp_in_form_add_param', 10); add_action('asp_layout_in_form', 'aslp_in_form_add_param', 10); function aslp_in_form_add_param() { echo '<input type=hidden name="trp_lang" value="'.transposh_get_current_language().'">'; } add_filter('asl_results', 'aslp_add_lang_param', 10, 1); add_filter('asp_results', 'aslp_add_lang_param', 10, 1); function aslp_add_lang_param($results) { if (is_array($_POST['options'])) $options = $_POST['options']; else parse_str($_POST['options'], $options); $url = get_site_url(); $lang_url = $url . '/' . $options['trp_lang']; foreach ($results as $k=>&$r) { $r->link = str_replace($url, $lang_url, $r->link); } return $results; }
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 16, 2020 at 1:31 pm #30300Hello,
I had already added this code but unfortunately without results.
on the forum there is also a notice of a change in the plugin ‘transposh’
Do you know what has changed there. there are private replys, so I can’t read itI hope there is a solution.
November 16, 2020 at 1:40 pm #30302I’m afraid this is no longer possible. The change in the mentions was related to something else.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.