This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Translation tags

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #17880
    MagineMMagineM
    Participant

    Hi,

    How can I make the search results not show the translation tags [:en] in the hints/suggestions?

    #17885
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    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.

    #17893
    MagineMMagineM
    Participant

    Hi,

    Unfortunately this didn’t help. 🙁

    #17902
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    May I ask which plugin do you use to place those tags there?
    Thank you!

    #17904
    MagineMMagineM
    Participant

    Hi,

    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.

    #17905
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Thank 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!

    #17907
    MagineMMagineM
    Participant

    Hi,

    Have tried the above code, but still no luck.

    #17987
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    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.

    #17988
    MagineMMagineM
    Participant

    You cannot access this content.

    #17994
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    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.

    #17997
    MagineMMagineM
    Participant

    Hi,

    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.

    #18002
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    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

    #18010
    MagineMMagineM
    Participant

    Hi 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.

    #18028
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Oh yea, I forgot about that.

    Change the code to this one instead. Then you can adjust the length by changing the $length variable.

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.