• I have made a custom link to an external page and have placed it in my menu. I am trying to make this link visible only to logged-in users – as you can with a private page or post – but cannot find a way to do this. Is this facility possible, please, and does anyone know how I can accomplish this if so? Many thanks for any help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You could create a different menu with all your custom links and then call it on your theme like this:

    <?php if ( is_user_logged_in() ) {
    wp_nav_menu( array(‘menu’ => ‘Name of your menu’ ));
    } ?>

    Hope this helps 😉

    Thread Starter michael walker

    (@michael-walker)

    Thanks. Yes, I guess that would work, although, tbh, I’m a little surprised WP won’t do this natively. I’d have thought it was a fairly common requirement. Anyway – thanks again for your thoughts.

    Actually i’ve never seen anyone ask that before :p

    But now that you brought it up, i agree it should be a native functionality. Lets hope they add that on the next update 🙂

    Thread Starter michael walker

    (@michael-walker)

    Indeed. I thought I was getting close when I discovered – in ‘Capabilities’ – items like: ‘Read private nav menu items’ Kind of made me think there must be some ‘private nav menu items’ to be read, but no luck there. Still don’t know what these are!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘How to hide custom link’ is closed to new replies.