在用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> ';
	}
 
?>

相关文章

  1. Fatal error: Call to undefined function: stripos()
  2. WordPress function bloginfo()
  3. php session tmp 路径错误
  4. JQUERY搜索框提示效果
  5. DeDeCMS 在列表调用'tag'标签

Vote

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...