This topic has 3 replies, 2 voices, and was last updated 7 years by Kieran_SQ.

  • Author
  • #209622
     islamir
    Participant

    In the main top menu I do not want certain menu items to appear except for logged in users.

    #209632
     Kieran_SQ
    Moderator

    Hi,

    You’ll need to install a third party plugin to achieve this. You can try Menu Item Visibility Control which can be found in the WordPress plugin repository for free. Once installed a new field is added to each menu item titled ‘Visibility’ where you can add your own logic.

    In your case, for logged in/out, it would be as follows

    Logged in only
    is_user_logged_in()

    Logged out only
    !is_user_logged_in()

    Plugin: https://wordpress.org/plugins/menu-items-visibility-control/
    Codex: https://developer.wordpress.org/reference/functions/is_user_logged_in/

    Thanks,

    Kieran

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #209653
     islamir
    Participant

    Thank you dear Kieran

    I was waiting for you to come back. Your support is really appreciative.

    The plugin helped me.

    #209656
     Kieran_SQ
    Moderator

    Hi,

    Glad I could help. Feel free to open a new ticket any time with any other questions and we’ll be happy to assist.

    Thanks,

    Kieran

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?