在用Qtranslate 做多语言网站的时候,常常发现自己写的代码输出的时候把中英文连带语言区分的容器 “” 也移动输出了。 解决方法就是在输出是用 function __() 或 _e() 进行处理即可: 例如: <?php $args = array( 'numberposts' => '10','category' => 1, 'post_status' => 'publish' ); $recent_posts = wp_get_recent_posts( $args ); foreach( $recent_posts as $recent ){ echo '<li><a href="' . get_permalink($recent["ID"]) . '" title="Look '.__($recent["post_title"]).'" >' . __($recent["post_title"]).'</a><span>'.$recent["post_date"].'</span></li> '; } ?>

Posted on 23, 九











