Tag: Qtranslate
修复 next_posts_link & previous_posts_link 与 qTranslate 的兼容问题
If your having problems with qTranslate and the next_posts_link / previous_posts_link & next_post_link / previous_post_link template tags then I recommend dropping the following two functions into your theme’s functions.php file. /*************************************************************** * Function qtranslate_next_previous_fix * Ensure that the URL for next_posts_link & previous_posts_link work with qTranslate ***************************************************************/ add_filter(‘get_pagenum_link’, ‘qtranslate_next_previous_fix’); function qtranslate_next_previous_fix($url) { return qtrans_convertURL($url); }…
让Qtranslate 支持 Custom Taxonomy
If you wanted to automatically detect taxonomies, and then add translation edit fields here is some code: 如果你想要自动探测 Custom Taxonomy,然后给他们加上翻译字段, 把这段代码放在主题的 function.php 里。 function qtranslate_edit_taxonomies(){ $args=array( ‘public’ => true , ‘_builtin’ => false ); $output = ‘object’; // or objects $operator = ‘and’; // ‘and’ or ‘or’ $taxonomies = get_taxonomies($args,$output,$operator); if ($taxonomies) { foreach ($taxonomies as…
Qtranslate With function __() and _e()
在用Qtranslate 做多语言网站的时候,常常发现自己写的代码输出的时候把中英文连带语言区分的容器 “” 也移动输出了。 解决方法就是在输出是用 function __() 或 _e() 进行处理即可: 例如: