Translation tags

This topic contains 13 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 6 years, 2 months ago.

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

    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.
    #17885
    Ernest Marcinko
    Ernest 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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #17893
    MagineM
    MagineM
    Participant

    Hi,

    Unfortunately this didn’t help. 🙁

    #17902
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

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

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #17904
    MagineM
    MagineM
    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 Marcinko
    Ernest 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!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #17907
    MagineM
    MagineM
    Participant

    Hi,

    Have tried the above code, but still no luck.

    #17987
    Ernest Marcinko
    Ernest 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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #17988
    MagineM
    MagineM
    Participant
    You cannot access this content.
    #17994
    Ernest Marcinko
    Ernest 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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #17997
    MagineM
    MagineM
    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 Marcinko
    Ernest 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

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #18010
    MagineM
    MagineM
    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 Marcinko
    Ernest 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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.