I want to include a login/out link in WordPress theme menu, and for that I used this code: PHP: <?php if(is_user_logged_in()){echo '<a id="login" href="'.wp_logout_url().'">Logout</a>';}else{echo '<a id="login" href="'.wp_login_url().'">Login</a>';}?> but it doesn't work. At first I thought that aMember wasn't detecting WordPress correctly, but my protected posts shows/hide as expected. What can I do?
Is it the logout link that isnt logging them out- or your code isnt detecting them as logged in? maybe change this .wp_logout_url(). to the amember logout url? /amember/logout If not registered in wordpress as logged in- then your integration isnt correct. David
The code isn't detecting login status, but after I post this thread, I spotted it showing as Logout, but maybe once or twice in like 50 page clicks/refreshes. And the aMember WordPress plugin works fine... I checked the integration... I didn't see anything wrong... is it because I'm using a local server (XAMPP on Windows)?