B
B
Blind-programmer2021-11-22 02:21:29
WordPress
Blind-programmer, 2021-11-22 02:21:29

How to add login and registration links in the header of a WordPress site?

I need that in the header of the site, when a person is not authorized, links to login / registration are displayed, and when authorized - the user's nickname and a link to logout.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Zolin, 2021-11-22
@Blind-programmer

if ( is_user_logged_in() ) {
  # пользователь авторизован
} else {
  # пользователь НЕ авторизован
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question