Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Translation tags
- This topic has 13 replies, 2 voices, and was last updated 8 years ago by
Ernest Marcinko.
-
AuthorPosts
-
May 16, 2018 at 1:53 pm #17880
MagineM
ParticipantHi,
How can I make the search results not show the translation tags [:en] in the hints/suggestions?
May 16, 2018 at 2:04 pm #17885Ernest Marcinko
KeymasterHi,
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.
May 16, 2018 at 9:11 pm #17893MagineM
ParticipantHi,
Unfortunately this didn’t help. 🙁
May 17, 2018 at 12:46 pm #17902Ernest Marcinko
KeymasterHi,
May I ask which plugin do you use to place those tags there?
Thank you!May 17, 2018 at 1:27 pm #17904MagineM
ParticipantHi,
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 #17905Ernest Marcinko
KeymasterThank 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!
May 17, 2018 at 2:16 pm #17907MagineM
ParticipantHi,
Have tried the above code, but still no luck.
May 23, 2018 at 12:30 pm #17987Ernest Marcinko
KeymasterHi,
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.
May 23, 2018 at 3:35 pm #17988MagineM
ParticipantYou cannot access this content.
May 24, 2018 at 9:47 am #17994Ernest Marcinko
KeymasterHi,
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.
May 24, 2018 at 10:30 am #17997MagineM
ParticipantHi,
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 #18002Ernest Marcinko
KeymasterHi,
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
May 24, 2018 at 1:37 pm #18010MagineM
ParticipantHi 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 #18028Ernest Marcinko
KeymasterOh yea, I forgot about that.
Change the code to this one instead. Then you can adjust the length by changing the $length variable.
-
AuthorPosts
- You must be logged in to reply to this topic.