qTranslate get content by language

How do you get the content by id and by specific language?

I need to display two specific language content in a page, regardless of the session’s language.
So far, this is my progress: this works fine for getting the content by id of the active language:

Read More
<?php $id=47; $post = get_page($id); $content = apply_filters('the_content', $post->post_content); echo $content;  ?>

How to apply a specific language to the filter?

Thanks for the help. Sziro

Related posts

Leave a Reply

1 comment

  1. You must use the qTranslate native functions to do your job. Use qtrans_use, that is the function that do all the job in qTranslate. It’s defined in qtranslate_core.php, line 747

    function qtrans_use($lang, $text, $show_available=false) 
    

    Use it on the raw content of the post!

    Try this code:

    <?php 
     $id=47; $post = get_page($id); 
     $content = qtrans_use('en', $post->post_content,false); 
     echo $content;  
    ?>
    

    In this example, it will return the English version of your text! Substitute it with the desired language identifier to translate into another language!