Titles in my sidebar widget appear in all languages – with qtranslate

Hi Will also try this: Add this to your functions.php function get_qTrans_TitleText($text) { $language=qtrans_getLanguage(); preg_match(‘/<!–:’.$language.’–>(.*?)<!–:–>/’, $text, $matches); return strip_tags($matches[0]); } And then: <?php echo get_qTrans_TitleText($text); ?> Have no Idea what version of qTranslate and WP you have so you may even use __() to get the correct title or _e() to echo it.

WPML: getting page title in different language

Let’s say the original language of your site is english, then when visiting a german post you would return the title of the corresponding english post like that : // Get the post ID of original post $original_ID = icl_object_id( $post->ID, ‘post’, false, ‘en’ ); // Get original post title $original_title = get_the_title( $original_ID ); … Read more

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

Setting WPLANG from a plugin

In wp-includes/l10n.php you will find the function get_locale(). It offers a filter; you can set the language and ignore the constant: function get_locale() { global $locale; if ( isset( $locale ) ) return apply_filters( ‘locale’, $locale ); // WPLANG is defined in wp-config. if ( defined( ‘WPLANG’ ) ) $locale = WPLANG; // If multisite, … 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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)