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:
<?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
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 747Use it on the raw content of the post!
Try this code:
In this example, it will return the English version of your text! Substitute it with the desired language identifier to translate into another language!