0

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

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

然而,这是代码显示我用 Qtranslate 定义的两种语言的内容。我怎样才能让它只显示它设置的语言的内容。

谢谢!

4

1 回答 1

0

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

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

应该做的伎俩

于 2013-06-24T16:27:58.060 回答