Support » Plugins and Hacks » Hide some page links for guests?

  • kronowski

    (@kronowski)


    Hi!

    I would like to hide some page links for guests visiting my page. The pages itself is alredy hidden thanks to the plugin “member acess”. But the links is still visible in the menu.

    I belive the code below would work for me. But I’m looking for a plugin that can do the same thing. Would be a lot easier for me to maintain the site then.

    <ul>
    <?php if ( $user_ID ) : ?>
    <?php wp_list_pages('depth=1&title_li=&exclude=' ); ?>
    <?php else : ?>
    <?php wp_list_pages('depth=1&title_li=&exclude=5' ); ?>
    <?php endif; ?>
    </ul>

    Appreciate any help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You probably want to look at is_user_logged_in()

    http://codex.wordpress.org/Function_Reference/is_user_logged_in

    so something like…

    if ( is_user_logged_in() ) { ... }
    else { ... }
    kronowski

    (@kronowski)

    Thank you for your reply.
    But what I’m relly looking for is a plugin that can do the job for me 🙂

    I would prefer a plugin because right now when the site is new there’s a lot of changes and it’s a lot of work if I have to change the code all the time.
    And as I understand it, for an easy upgrade process it’s better to have plugins.

    there’s no plugin available that will just do it all for you.

    it’ll be something you need to code onto the site manually, it’s a very specific need

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hide some page links for guests?’ is closed to new replies.