WordPress - Check if user is logged in

后端 未结 6 1608
逝去的感伤
逝去的感伤 2020-12-08 19:35

I am fairly new to WordPress. On my homepage I have a navigation bar which I only want to show to people who are logged in as users.

In my header.php th

6条回答
  •  隐瞒了意图╮
    2020-12-08 20:15

    This problem is from the lazy update data request of Chrome. At the first time you go to homepage. Chrome request with empty data. Then you go to the login page and logged in. When you back home page Chrome lazy to update the cookie data request because this domain is the same with the first time you access. Solution: Add parameter for home url. That helps Chrome realizes that this request need to update cookie to call to the server.

    add at dashboard page

    
     
    

提交回复
热议问题