显示特定帖子QTranslate时只显示一种语言

时间:2013-06-24 14:38:11

标签: wordpress qtranslate

我正在使用以下代码显示PostID为4的帖子内容:

<?php $post_id = 4; $queried_post = get_post($post_id); echo $queried_post->post_content; ?>

然而,这是代码显示我用Qtranslate定义的两种语言的内容。如何才能使其仅显示所设置语言的内容。

谢谢!

1 个答案:

答案 0 :(得分:0)

如果我理解正确,您应该能够通过__()_e()函数运行内容,让qTranslate提取当前语言的内容。所以

<?php
$post_id = 4;
$queried_post = get_post($post_id);
_e($queried_post->post_content);
?>

应该做的伎俩

相关问题