It’s relatively simple to achieve that, you need to use the is_user_logged_in()
function, as follows:
<div class="fix floatleft sign_in">
<?php if(is_user_logged_in()) : ?>
<a href="http://www.chicago-plastic-surgeons.com/wp-login.php?action=logout&redirect_to=http%3A%2F%2Fwww.chicago-plastic-surgeons.com&_wpnonce=6049e0b736">Log out</a>
<?php else : ?>
<a href="http://www.chicago-plastic-surgeons.com/wp-login.php">Sign In</a>
<?php endif; ?>
</div>
The code asks whether the current user is logged in, and if they are show the log out button, if they’re not logged in, it will show the log in button.
You can find out more information about the is_user_logged_in
function on the WordPress Codex.
Related Posts:
- Disable Or Redirect WP-login.php
- login_enqueue_scripts does not ovewrite the default styles
- Modify wp-login.php labels: Username to Email
- How to change “Registration complete. Please check your e-mail.” in wp-login.php
- How to use wp-login.php page only for logout?
- change register url on wp-login page
- Can’t access wp-admin
- How do you add a custom link to the wordpress login page?
- wp-login.php register/lost password links to buttons?
- How to trigger a login form notice message?
- A child theme version of wp-login
- reset password label text change
- Add text on wordpress admin login page
- How to bypass the username as a required field in registration and just use email address instead?
- Is it possible to remove the version number from the wp-login.php page?
- wp_login_form() redirect not redirecting users < admin
- Login redirect on wp theme
- Can’t log in. Log in button missing [closed]
- Require WP login for outside access
- Modify WP-Login Page With Javascript?
- if username or password is incorrect wp-login returns a blank page
- Where is the email content for retrieve_password_message stored?
- What is the CODEX intercept for wp-login.php?action=lostpassword
- Call header and footer on login page
- Prevent redirect on custom wordpress login form
- Replace standard Login and Register form for Woocommerce [closed]
- How to destroy sessions after a user logout [closed]
- How to add required attribute to wp_login_form fields?
- WordPress “remember me” – How should it work?
- Changing the title of “
- Log In & Log Out Code In Header
- How can I redirect on a url after successful registration?
- I lock the site’s contents, click on a post, redirect to login, enter uname+password but fail to redirect to article
- How to access the actual input html of the login form
- Creating a custom login on site.
- Login page wordpress tagline remove [duplicate]
- Adding line break in esc_html__
- Copying My account/Login/Register button outside header
- Issue with cookies in wp-login
- Add content in wp login page
- Is it possible to check if password is correct in wp_authenticate_user?
- Modify login page after clicking “login” button, and before it arrives at redirect
- How to enable “remember me” checkbox in login forms by default?
- custom login query for custom login form?
- WordPress reCAPTCHA Problem
- Customizing WordPress Login URL
- It is possible that to get data in wp_login.php to your own php file in wordpress?
- Using gettext on wp-login.php won’t change “Back to site name” text
- Add video to wordpress login page
- WordPress login form with fancybox
- I wanna create a custom login form template
- Add custom field in wp_login_form()
- Retrieve password only by login. Users with same email
- wp-login.php not returning error messages / or gives 404
- Registration page background color covering 1 screen not covering full page
- Custom error messages for login and lost password forms
- WordPress does not allow me to login until another dashboard is open
- How can I redirect user after entering wrong password?
- Unable to login and wp-login.php redirects to wp-admin%2F&reauth=1?
- wordpress redirect after password reset
- The website cannot display the page
- Why is WordPress Multisite redirecting to wp-signup.php and how to fix it?
- Custom login form
- Prevent wp_login_form() from redirecting to wp-admin when there are errors
- Adding “Remember Me” in custom login
- How do I change the language of only the login page?
- Disable WordPress 3.6 idle logout / login modal window / session expiration
- Change Login URL Without Plugin
- Avoid to load default WP styles in login screen
- How to fake a WordPress login?
- How build a custom login/register form with error handling?
- Can not login with correct username and password
- Custom ReCaptcha Login
- How can I add a custom script to footer of login page?
- Custom login form redirect to external site
- How to keep always logged in development environment
- adding rewrite rules in .htaccess
- Clarification on auth_redirect()
- WordPress AJAX Login Screen
- Logout/login redirect CSS issue
- Multi-steps WordPress registration : in 4 steps how to?
- I want to disable E-Mail verifcation / activation when a user signs up for my WordPress site
- custom login page redirect to logged in user profile page
- How to redirect all requests to wp-login.php?
- How can I modify the default reset (lost) password email text?
- How to override wp-login.php
- Change “You are now logged out” text
- Action wp_login_failed not working if only one field is filled out
- How to customize the wp-signup.php for a multisite network?
- How to customise wp-login.php only for users who are setting a password for the first time?
- How can I do customizations on login, registration and password recovery forms?
- How to redirect users to custom lostpassword page?
- WordPress Login Footer URL
- Remove built in wordpress login and use only google auth
- Change Login Page for a Multisite Subsite
- Redirect user after login/registration globally
- Positioning the “Lost your password?” and “← Back to Site”
- hook for lostpassword form
- WordPress 4 invalid username special charachters issue
- wpmu_signup_user_notification filter not working