Is there a way to add a button to a custom menu that displays "login" when a user is not logged in, and "log out" when a user is logged in?
Is there a way to add a button to a custom menu that displays "login" when a user is not logged in, and "log out" when a user is logged in?
There's a widget that does that (called Meta). What kind of menu are you talking about?
I think I figured it out, with this code:
function loginlogout_button() {
if ( is_user_logged_in() ) {?>
<div id="loginbutton"><a>" title="Logout">Logout</a></div><?php;
} else {?>
<div id="loginbutton"><a href="[USER DEFINED URL]" title="Login">Login</a></div><?php;
};Hi,
Can this insert to a manually insert button??????? Ex. If an user login button image should be "pay now" and if not button image should be "register".
Can this be done with above code?????????
This topic has been closed to new replies.