• Hi,

    This might be a long shot, but I’m trying to see if anyone had the same problem and found a solution. I’m developing a WP 3.1 site for a client that relies on tag descriptions to display some info on the tag archive page. After I found out how this field would accept basic HTML, I stumbled upon another problem.

    I use the qtranslate plugin to make sure the site is accessible in both Dutch and French, and this plugin allows me to translate the tag name in both languages, but not the tag description field, which means this is always displayed in one language. I’ve tried all kinds of shortcode provided by qtranslate, without any effect.

    Elsewhere on these forums I found a solution to make sure the category descriptions (which had the same problem) would be displayed in the correct language using the shortcodes:

    <?php
    $category = get_the_category();
    _e($category[0]->category_description, 'qtranslate');
    ?>

    Sadly, this code doesn’t work for tags, so I tried adapting it for the tag description as such:

    <?php
    $posttags = get_the_tags();
    _e($posttags[0]->tag_description, 'qtranslate');
    ?>

    Didn’t work. Does anyone know what is wrong with the above code? How come this works for categories and not for tags?

    Thanks in advance for any offered help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Stef Verbeeck

    (@twizted)

    For those of you that might ever look for a solution, here it is:

    <?php
    $tags = get_the_tags();
    _e(tag_description(),'qtranslate');
    ?>
    Jorge Toledo

    (@jorgetoledo)

    Hi, Stef

    Thank you VERY much for this post, it was of great help!

    In case someone wants to add only the current tag (for instance, in order to show the current tag&tag_description on top of the sidebar when viewing a tag page), this variation of Stef’s code worked nicely for me:

    <?php _e(tag_description(),'qtranslate');?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[ Plugin: Qtranslate ] Tag descriptions in multiple languages’ is closed to new replies.