WordPress.org

Ready to get started?Download WordPress

Forums

Hide page from User (1 post)

  1. codyt
    Member
    Posted 3 months ago #

    I want to hide a page from a user,(user_id == 3). It could be any page, I just want to know how to hide a page from that specific user.

    There are so many php functions that I'm not sure where to start with this one being a newbie here.

    Maybe someone could transform this?

    `<?php $user_id = get_current_user_id(); ?>
    <?php if ( $user_id == 3 ) { ?>
    <p>This text is only visible to user 3.</p>
    <?php } ?>`

    If not, no worries. All I really need right now is a lead, which WordPress tags should I be using to do this?

    Thanks in advance!

Reply

You must log in to post.

About this Topic