• i’ve been dabbling with a few different user permission plugins for wordpress, but what i really need is something that can make certain pages only visible to users who aren’t logged in. anybody have any experience with this?

    essentially what i want to do is build a login page that will disappear when users login (it will be replaced by another page that’s already been built). i’ve done some thorough searching and have found plenty of ways to only show pages to users who are logged in, but nothing that works the other way around.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Have you looked at trying something along these lines:

    if ( is_user_logged_in() ) {
      // show some page to logged in users
    } else {
      // show log in page
    }

    From the core ../wp-includes/pluggable.php

    is_user_logged_in (line 718)

    Checks if the current visitor is a logged in user.

    * return: True if user is logged in, false if not logged in.
    * since: 2.0.0

    bool is_user_logged_in ()

    Hope that gets you looking in a direction that works.

    Did it work for you? what is your code? Thx!

    I now use the CaPa plugin and works great!!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘show page only to users who are NOT logged in’ is closed to new replies.