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
the function is_logged_in
doesn't seem to work.
I want to place a condition in my header.php
file to check if the user has logged in (and then display the navigation).
Any advice would be helpful.
Try following code that worked fine for me
Then, use following code to check whether user has logged in or not.
I think that. When guest is launching page, but Admin is not logged in we don`t show something, for example the Chat.
Use the
is_user_logged_in
function: