WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [qtranslate] problem with category description translations (4 posts)

  1. hugobs
    Member
    Posted 3 years ago #

    hi, i installed the qtranslate plugin and it works great.

    except for category descriptions:

    for each category, i have my category description displayed on the top of category posts (i allow html in category descriptions, with the 'category descriptions editor' plugin).

    to have category descriptions displayed above my posts, i inserted this...

    <?php if (is_category()) { ?>

    <?php
    $category = get_the_category();
    echo $category[0]->category_description;
    ?>

    ... in my _posts.php.

    with qtranslate, language-switching is usually done thanks to quicktags ([:en]Text [:fr]Texte [:es]Texto) or normal tags <!--:en-->Text<!--:-->(<!--:fr-->Texte<!--:--><!--:es-->Texto<!--:-->).

    in my situation, qtranslate does not switch > all 3 languages are shown (i.e. Text Texte Texto) :(.

    any clue on what has to be tweaked?
    thanks in advance!

  2. hugobs
    Member
    Posted 3 years ago #

    well i found the solution...

    <?php if (is_category()) { ?>

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

    ....works like a charm!

  3. hoolianv
    Member
    Posted 3 years ago #

    hey thank you! it worked for me too

  4. Stef Verbeeck
    Member
    Posted 3 years ago #

    Does this work for Tag descriptions as well? I tried this code in my templates tag.php, without success:

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

Topic Closed

This topic has been closed to new replies.

About this Topic