qTranslate get content by language [closed]

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); … Read more

Change language by clicking a button

By far the best (easiest) way is to use the locale filter (inside get_locale()). First set up a quick function for retrieving a different language to use on the locale filter. /** * A function returns with returns the user’s selectd locale, if stored. */ function wpse35622_get_new_locale($locale=false){ $new_locale = get_user_meta(get_current_user_id(), ‘wpse_locale’, true); if($new_locale) return $new_locale; … Read more