Wordpress已注销用户


Wordpress Logged Out Users

我正试图在我的header.php文件中添加一个链接,该链接在用户登录后消失…所以该链接只显示给已注销的用户。。。有人能帮忙吗?

在header.php文件中放置以下代码

<?php if ( !is_user_logged_in() ) { ... } ?>

将您的链接放在{}中。。。是.

有关更多信息,请参阅函数参考-is_user_loged_in()及其相关函数。

global $user_ID,$current_user;
get_currentuserinfo();
if ( $user_ID ) { .. }

您可以获得当前用户登录名。