How to make the Edit Profile link on my menu disappear on mobile devices?

Hello,
Website: http://yourtechadvisors.com
On the main menu, there is an Edit Profile link. This link is automaticly hidden when logged out. For some reason, the code below will not hide it on my mobile menu, could someone please recommend a code change or a way to hide on my mobile menu?

Code:

/*Navigation Profile Link*/
#navigation li.profile {
display: none;
}
.logged-in #navigation li.profile {
display: block;
}

Thanks.

  • Milan
    • WordPress Wizard

    Hello @Alex,

    I hope you are having a good day and thanks for asking. :slight_smile:

    The reason why its not hiding from mobile is because on mobile its rendered as dropdown, which is element comes in the picture when your page rendered on mobile devices.

    As I can see, you want to hide that menu for non-logged in user only right ? I think you can achieve this with the help of this nice plugin easily,

    https://wordpress.org/plugins/privilege-menu/

    This plugin will give you ability to setup menu for logged in and logged out user. You can easily remove edit-profile menu item for non-logged in user.

    Once you activate plugin you can then easily edit each individual item to specify it for login or non loggedin user as shown in attached screenshot.

    Will it help dear @Alex ? Or you want this do be done by custom code only ?

    Please let me know if there is anything else I can help you with.

    Best Regards,
    Milan Savaliya.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.