Hide 'LOG IN' Header menu once logged in - Log In page created and linked to menu

Topic summary

A user created a custom ‘Log In’ page linked to a header menu but encounters two issues:

Problems identified:

  • The ‘LOG IN’ menu item remains visible even after users successfully log in
  • When logged-in users click the menu item, they get logged out and must re-authenticate

Solution provided:
A community member suggested wrapping the login link code in a conditional statement that checks if customer.id is null. This ensures the login link only displays when users are not logged in:

{% if customer.id == null %}
Your login link here
{% endif %}

Another respondent requested the store URL to investigate further. The thread appears to provide a working solution but awaits confirmation from the original poster.

Summarized with AI on November 14. AI used: claude-sonnet-4-5-20250929.

Hi There,

I have created a ‘Log In’ page and linked it to the assoicated ‘LOG IN’ Header menu.
Im looking to see once a user logs in sucessfully the ‘LOG IN’ meun is still displayed and if the user selects the meun, its seems the user is then logged out need to re-login again.

Is there a what to hide LOG IN footer menu once user is succefully logged in?

Appricate assistants .

Thanks

DaGeneral

Hi @DaGeneral

Please share your store link to check

Hi @DaGeneral you can wrapped you code within this if condition, it will show only is user is not logged in

{% if customer.id == null %}
Your login link here
{% endif %}