• Resolved do77

    (@do77)


    Hi,

    I would like to make certain parts of a page only accessible to registered users.

    Each post comes with contact information of the author (e-mail etc.). While the actual post should be accessible to everyone, only registered users should be able to read the contact information. If you are not logged in, a grey box (or so) should appear, where usually the contact information are showed, saying ‘you need to be logged in to view this part’.

    Aynone an idea how to achieve that? Is there a plugin or should I do it with an if statement? The contact information of the author are inserted via a custom field.

    Thanks,
    do77

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter do77

    (@do77)

    Can I actually use this conditional tag and call the custom field within the echo ” ?

    ?php
    if ( is_user_logged_in() ) {
        echo 'Welcome, registered user!';
    } else {
        echo 'Welcome, visitor!';
    };
    ?>

    I need to do exactly the same thing…almost: need different levels of logged-in users. Members-only access to the sensitive part of pages, and sensitive parts blocked to non-logged in AND folks who register for the purpose of buying tickets for events open to the public (using Events Manager plugin for that)

    Would your idea work with custom roles? And on posts? (I think events added in Events Manager are technically posts)

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to restrict access to certain 'parts' of a page?’ is closed to new replies.