-
Hey, I have a ‘My Profile’ link in the top nav and the dropdown of that link has Login, Register, Submit, Edit Profile , Log Out. How do I create it so when the user is logged in, that the ‘Register’ does not appear anymore? Same with when not signed in, the Log Out still shows. Is there a tweak in the user accounts to adjust this?
I’m not the best coder in the world but..
in header.php after the
</head>
add in..PHP1234567if ( ! is_user_logged_in() )$body_class .= 'not-logged-in';else$body_class .= 'logged-in';?>in your styles.css – add in..
PHP123456.not-logged-in .not__logged_in {display: none;}.logged-in .logged_in {display: none;}Now in Menus, go to options at the top and enable CSS classes in advanced properties. All you have to do now is add the
logged_in
ornot__logged_in
code into the css classes of each menu item.hope this helps Klsbo.
the header.php code where ‘'’ is actually commas (sorry not able to swap them out in code mode)
@Jesse, thanks I’ll give this a try with my theme and let you know!
You must be logged in to reply to this topic.