customer login / private page (2 posts)

  • Profile picture of Vincent Gentile Vincent Gentile said 2 years, 2 months ago:

    Hello – My client requests a customer login or private pages on the site for users to access private information. In the past, I have done this by creating the page and adding a password, however the client doesn’t want the page visible on a navigation menu.

    Is there a way to do this or a widget that will accomplish this..?

  • Profile picture of Steve Steve said 2 years, 2 months ago:

    hi Vincent,

    I think the best way to do it is with a Page Template:

    http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

    Then wrap all the top secret content with a conditional:
    if (is_user_logged_in()) {
    // You page code goes here
    } else {
    echo “You must be logged in to view this page.”;
    }

    Hope that helps,

    Steve