Disable qTranslate by post type in admin + disable per page / post ID on front-end [closed]

Following snippet will disable it for post_type post (modify array below to affect other post_types): function qtrans_disable() { global $typenow, $pagenow; if (in_array($typenow, array(‘post’)) && // post_types where qTranslate should be disabled in_array($pagenow, array(‘post-new.php’, ‘post.php’))) { remove_action(‘admin_head’, ‘qtrans_adminHeader’); remove_filter(‘admin_footer’, ‘qtrans_modifyExcerpt’); remove_filter(‘the_editor’, ‘qtrans_modifyRichEditor’); } } add_action(‘current_screen’, ‘qtrans_disable’); Similarly you can disable it for specific post IDs. … Read more

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.

Difference between bloginfo(‘home’) and home_url() and site_url()

The difference in your case is in filters being applied to output of these functions. While bloginfo applies one of these filters: if ( ‘display’ == $filter ) { if ( $url ) $output = apply_filters(‘bloginfo_url’, $output, $show); else $output = apply_filters(‘bloginfo’, $output, $show); } Function home_url applies this filter: return apply_filters( ‘home_url’, $url, $path, … Read more

How to force WordPress to temporarily switch locale (using qTranslate)? [closed]

And I got it. What was missing was re-loading the text domain for WooCommerce, that was loaded with the current locale at initialization: // set the current locale and send email with it active unload_textdomain(‘woocommerce’); setlocale(LC_ALL, $new_locale); global $q_config, $locale, $woocommerce; $locale = $new_locale; $q_config[‘language’] = substr($new_locale, 0, 2); $woocommerce->load_plugin_textdomain(); global $wc_cle_wc_email; $wc_cle_wc_email->customer_completed_order($order_id); // set … 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

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