Checking if the User is Logged In

Purpose: This article will show you how to check if the User is logged in. It will also show you how to show specific content to logged in vs. non logged in users.

You can use the following tag to determine if a user is logged in:    {% current_user %}
This tag returns false if the user is not logged in, and true if the user is currently logged in.
To Hide Content from a non-logged in user: If you had content that you wanted to only display to Users who were logged in, you would simply wrap your content inside of {% if current_user %} and {% endif %}
It would look like:

{% if current_user %}
      [your_content_goes_here]
{% endif %}
To Show specific content to users based on their logged in status:  If you wanted to show some content to logged in users and other content to non logged/signed up user

It would look like:
{% if current_user %}
     [your_content_goes_here_for_logged_in_users]
{% else %}
     [your_content_goes_here_for_non_logged_in_users]
{% endif %}
Note: Importantly, you can use this tag in any liquid view (Theme > Liquid Views, Theme > Homepage, Theme > Header, Theme > Footer), but please be careful not to use this tag in Theme > Homepage Content, which is different from Theme > Homepage. If you place this in Homepage Content, the tag will not work as expected - so if you need to display some content on the homepage using this method, you should place this logic inside Theme > Homepage