What is the is_loggedin() function ? Is that something you have create by yourself ?
WordPress already got what you need, : is_user_logged_in()
You can use is_home() & is_user_logged_in() to be sure that the content will not display on other page.
As @Ivan Shatsky say’s, don’t use “else condition” like that.
//Home.php file
if (is_home() && is_user_logged_in()) {
get_header('login');
//My content
get_sidebar('login');
get_footer('login');
} else {
get_header();
//My content
get_sidebar();
get_footer();
}
Not tested !
Related Posts:
- Can I programmatically login a user without a password?
- How to login with email only no username?
- Removing username from the ‘wordpress_logged_in’ cookie
- Woocommerce registration page [closed]
- Share login data/cookies between multiple installations
- Is it possible to sign in with user_email in WordPress?
- How to use current_user_can()?
- WordPress registration message
- How can I create a separate blog that is private?
- Email address or username used to login in wordpress
- How to customise wp-login.php only for users who are setting a password for the first time?
- Remove built in wordpress login and use only google auth
- Websites defaced by uploading script using theme editor
- Make wordpress admin failed login attempt return 401
- Login redirect_to loop with reauth=1, cookie expiry set to 1 year in past
- User Login Form Outside the Default wp-login Form
- I am not able to login to my wp-admin panel
- Block Logged-Out User Access to Directory Outside of WordPress using .htaccess and PHP file
- how to logout user on browser tab or window closes
- Integrate WordPress Blog with Moodle LMS
- Making a client page
- Auto login user with link from Mail
- To be able to login as different user
- How do I Create Forums with bbpress Plugin that can only be Viewed by Logged in Users
- Add class to input form in login form
- Can’t Login to WordPress, No Data Received Error
- Unable to access website admin page – 500 error – how to change landing page
- how to restrict user login whenever if a user puts on hold by editing wp-login action?
- WordPress/Buddypress login theme function [closed]
- Login redirects and query strings
- wp-admin folder, brute force, and password protection
- Allow Users Only Edit Their Profile?
- User Login System with File Delivery?
- Chrome 83 doesn’t connect WP login page after update from http to https on localhost
- WordPress login problem
- Skip login form wp-login.php when already logged in,
- Forcing SSL login, have to log in again from WP/BP-Admin Bar
- Call header and footer on wordpress default login page
- Does WordPress (or a plugin) reveal login credentials to admin?
- Notifications when someone is on the site
- How can I prevent anyone from logging into a WordPress failover site?
- How to password-protect everything except the logo
- Generate email on meta value update
- Login Redirect Error – $user->roles
- WordPress login security
- Why isn’t the login page rate limited by default?
- how can redirect sign in and sign out link front-end page rather then wp-login .php in comment form in wordpress
- Input sanitation
- Advice on redirect to lock site from unauthorized users
- Custom code needed to be executed on login and logout
- Sending new registration meta values to admin by email
- Single Time Login HELP
- Allow Access to Home Page and Login Screen but Nothing Else (unless logged in)
- Error on WordPress Login
- Reloading page with a query string upon login for admins
- force login loophole
- Alert Message through email or phone(Message)
- Custom login page problem!
- Looking up WordPress account information from Host or php files
- Get WordPress login functions without printing anything
- Multiple issues with Ajax login function due to browsers and cookies
- Allow login only for one account from one device
- URL with login details included for public members
- woocommerce store login not working at first time
- How is it possible to current user info on page in WordPress?
- Trouble when I try to connect to WordPress
- Custom failed login error messages for users based on user role?
- Recognize custom login page as wp-login.php
- Set logged in user based on API response
- Can’t login to wordpress, got ERR_EMPTY_RESPONSE after a few minutes
- Create a login page which redirects to a specific page?
- wp_signon works localhost but not wokrs https site
- how to add social login option in wordpress
- Allow log in to the dashboard only from specific gadget?
- Why deleting/removing cookies in WordPress does not log me out from admin?
- How to use google api for wordpress login
- Avoiding accidentally creating a second account at “Or log in with your existing social profile”
- Can we start session from another php site to wordpress blog site?
- display last login date in the frontend
- How user should automatically activated and go for login?
- How to lock WordPress front-end with login and password?
- Site is not loading after relogin attempts on SSL
- Log in to wordpress after executing another form function
- Disabling the login form and redirect users on logout without headers sent php warning
- WordPress keeps redirecting to an unsecure connection?
- A way to redirect users when they log in based on their current page
- Webpage not found upon entering wrong username and password on custom login form?
- changing WordPress login page
- Where do I find “log in” and “register” link which are located on the top right corner?
- Check to see if there a wordpress user account and create one if not outside of wordpress
- User not logged first time I open the homepage
- How to force login after user browses for a few minutes or browses a few pages?
- WordPress Login Box horizontal at the top.
- Cannot login with correct username and password anymore
- How to limit user to login only once per session
- How to make WordPress keep me signed in? [duplicate]
- how to add custom word press regisration form in word press 3.5 with out module [closed]
- Warning-session start errors and cannot login to administer
- make a login system for site visitors
- Must Log In to Visit Site [duplicate]