我使用以下代码显示PostID为4的帖子的内容:
<?php $post_id = 4; $queried_post = get_post($post_id); echo $queried_post->post_content; ?>
然而,这是代码显示我用Qtranslate定义的两种语言的内容 . 如何才能使其仅显示所设置语言的内容 .
谢谢!
如果我理解正确,您应该能够通过 __() 或 _e() 函数运行内容,让qTranslate提取当前语言的内容 . 所以
__()
_e()
<?php $post_id = 4; $queried_post = get_post($post_id); _e($queried_post->post_content); ?>
应该做的伎俩
1 回答
如果我理解正确,您应该能够通过
__()
或_e()
函数运行内容,让qTranslate提取当前语言的内容 . 所以应该做的伎俩