开发者

Get current user name in WordPress theme (3.2)

I'm creating a WordPress theme, but I can't get the current username. I tried get_currentuserinfo() but it doesn't seem to work. Is th开发者_如何转开发ere any working function to get the username that I can use in the header.php template file?


Did you read the documentation, this example work well for me :

<?php 
  global $current_user;
  wp_get_current_user() ;
  echo $current_user->user_login;
?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜