[resolved] Link in Navigation only for registered users (4 posts)

  1. mpat
    Posted 5 years ago #

    I wan't to add a link to the main navigation. How can I make it visible only for registered users? For articles/pages that't not a problem. Could you help me please?

  2. http://codex.wordpress.org/Function_Reference/is_user_logged_in is what you need to use.

    <?php if ( is_user_logged_in() ) { YOUR LINK HERE } ?>

    You'll need to edit your theme to do this, and I don't know if you can for the built in menu tool just yet.

  3. mpat
    Posted 5 years ago #

    I solved it with CSS:

    #menu-item-123 { display:none }
    .logged-in #menu-item-123 { display: inline-block }
  4. Hah! That'd do it :) Nice catch!

Topic Closed

This topic has been closed to new replies.

About this Topic