由于某些参数未登录用户的某些原因,我想显示未发布的帖子。我可以从 WP 管理面板配置此功能吗?如果不能,我可以在哪里更改代码中的此逻辑?
问问题
3477 次
1 回答
2
为此使用内置函数is_user_logged_in()
:
<?php
if ( is_user_logged_in() ) {
//show the post
} else {
//continue as normal
}
?>
于 2013-07-18T10:33:05.603 回答