Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Translation tags
This topic contains 13 replies, has 2 voices, and was last updated by Ernest Marcinko 5 years, 6 months ago.
- AuthorPosts
- May 16, 2018 at 1:53 pm #17880
Hi,
How can I make the search results not show the translation tags [:en] in the hints/suggestions?
Attachments:
You must be logged in to view attached files.May 16, 2018 at 2:04 pm #17885Hi,
On the Advanced Options -> Content panel try changing the What to do with shortcodes in results content? option to Execute them: https://i.imgur.com/Fes2ziz.png
It will apply the ‘the_content’ filter on the content field first. If those translation tags are shortcodes or in any way connected to that filter, then this should do the trick.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
May 16, 2018 at 9:11 pm #17893Hi,
Unfortunately this didn’t help. 🙁
May 17, 2018 at 12:46 pm #17902Hi,
May I ask which plugin do you use to place those tags there?
Best,
Thank you!
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
May 17, 2018 at 1:27 pm #17904Hi,
I’m using the qtranslate-x plugin.
It only seems to show the [:en] markup from the category descriptions that have translations on them. So during a search when it gives you suggestions/results and it’s a category, the description copy it shows has those tags.May 17, 2018 at 1:50 pm #17905Thank you for letting me know, indeed, the post type results seem okay. I think the only solution is to try a custom code to get the translated descriptions.
Add this custom code to the functions.php in your theme/child theme directory (copy from line 3 only!). Before editing, please make sure to have a full site back-up just in case!
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
May 17, 2018 at 2:16 pm #17907Hi,
Have tried the above code, but still no luck.
May 23, 2018 at 12:30 pm #17987Hi,
Can you add temporary back-end and FTP access so I can check on this directly? Maybe a different function is required, but I am not able to tell based on the qTranslateX documentation.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
May 23, 2018 at 3:35 pm #17988You cannot access this content.May 24, 2018 at 9:47 am #17994Hi,
Unfortunately that will not help in this case, as it is not a configuration issue.
Are you sure that the code above does not work? I have tried it on several test environments, but I get the correctly translated term description every time.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
May 24, 2018 at 10:30 am #17997Hi,
You can have a look in the functions.php and you’ll see I’ve got the code running, but with no luck.
When you test the site in DE you’ll also see it only shows the EN results for the categories and not the DE.May 24, 2018 at 11:44 am #18002Hi,
The code is there, but it is in the incorrect location, it is encapsulated within the previous function before the closing parenthesis, so it has no effect.
I have tried to fix it via editing the functions.php, but it does not let me via the back-end. This should be the correct functions.php file: https://gist.github.com/anag0/7dcce5fccb03111190444e8b5f47dabe
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
May 24, 2018 at 1:37 pm #18010Hi Ernest,
Great!! That works. Thank you!!!
One other questions though… any way I can limit the number of words / characters it shows in the suggestions for the category description? It doesn’t seem to shorten it like it does for the posts / pages etc.
May 25, 2018 at 1:38 pm #18028Oh yea, I forgot about that.
Change the code to this one instead. Then you can adjust the length by changing the $length variable.
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.