WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Different code snippet for logged in users (3 posts)

  1. applegateian
    Member
    Posted 9 months ago #

    Hi

    I am aware it is possible to provide a different home page for a logged in user and non-logged in user. However, I would like to only change one snippet of code for users who have logged in, and those who haven't.

    Is there a way to wrap some HTML to say show this for logged in usersand then show this for everyone else?

    Thanks,

    Ian

  2. Gwyn
    Member
    Posted 9 months ago #

    If you're editing a theme file rather than post/page content you can use a conditional statement with is_user_logged_in- see:
    http://codex.wordpress.org/Function_Reference/is_user_logged_in

  3. applegateian
    Member
    Posted 9 months ago #

    Great thank you.

Reply

You must log in to post.

About this Topic