In the header.php of your theme you can add the following code @ the beginning of the php code
if ( is_user_logged_in() ) {
header( 'Location: /' );
} else {
header( 'Location: /wp-login.php' );
}
If the user is not logged it will be redirected to the login form else it will be redirected to the /home page or tha page u want.
Related Posts:
- Upgrade 4.5.2 to 4.5.3 deleting row in wp_options table
- ‘Global’ settings page for multisite plugin
- How to add field for new site-wide option on Network Settings screen?
- Contact form 7 select box different value-text than content-text in option [closed]
- Modifying a JS file with data from plugin settings
- Correct way to serialize the data of options table?
- Login with OpenID, similar to Stack Exchange sites?
- How can I make an Ajax login form work with FORCE_SSL_ADMIN enabled?
- Where should I use get_option in a plugin
- Inherit plugin settings to new site in Multisite
- How to tell if plugin has been network activated
- Is there a hook attached to general settings save?
- Change success message in plugin Theme my login
- How to get Login Error messages on a custom template
- How to find out if option exists but is empty?
- How should I use register_setting, add_settings_section, & add_settings_field in my plugin’s options page?
- Custom plugin settings: clicking “save changes” does not display success message
- How can a Firebase user registration and login be integrated into a WordPress site?
- How to get user-meta from Social Login registered users?
- Duplicate settings of master blog to slave blogs in WP multi-site installation
- Auto login using Active Directory and Windows Authentication
- Environment Specific Options Token
- How do I extract the Alt Text from an image attachment upload via the WordPress Options Framework Plugin?
- Which hook should be used to validate custom form fields on the login form?
- Network-Wide Plugin Settings Management
- How can I make content disappear when a user logs in?
- How to create a Page alias in WordPress
- How to create custom LOGIN and REGISTRATION forms?
- Tracking last login and last visit
- How to fetch serialized data from wordpress options
- login to wordpress with Get variables instead of Post
- Add custom meta box on Post page
- Some Plugin Settings Are Kept After Removal and Reinstall of the Plugin
- Changing widget options via the functions.php when there are no hooks
- While Using Static Pages, How Can I Get /blog into the URL of Each Post?
- Prevent Brute Force Attack
- Login with email (WP Modal Login)
- Check if the front end user is log in or not
- Get all options saved by another plugin
- wordpress custom login successful redirect hook
- How to create a word press user with hashedpassword
- WordPress with CAS+LDAP and standard WP accounts
- Is it ok to call get_option without hooks?
- Enable/Disable WP options programmatically
- Custom options page checkbox will not save, despite working with text
- Settings API – input always updates over validation
- add function to saving change on Options Pages
- get_option return incorrect values
- AJAX login without a plugin does not work. when add a action to function.php
- Option page not updating multiple records in settings api
- get_option returning old value for non-admin users
- Plugins effecting layout & login
- Add a checkbox in plugin options page and make it actually work
- Redirect default login page to a custom page [duplicate]
- Create Array from data in the OPTIONS table
- wp-admin will not redirect to wp-login.php
- Is saving multiple options or saving multiple items in one option better?
- Error when renaming option
- Validating values using Settings API?
- Adding google authenticator and use only email address of user
- Saving an array to get_options
- get Options value in “external” page
- Adding a Filter to Sidbar Login Plugin to Change Login Button Lable
- First argument is expected to be a valid callback for cp_admin_init and _canonical_charset
- ‘all’ hook and get_option issue
- How to find an option in the database?
- homepage olderposts link showing page not found
- Building a simple “settings” plugin to change textstrings on the home page
- WordPress ReAuth =1 Loop with wpCAS
- WP e-commerce sales-view
- My first plugin doesn’t save the data in options
- HTTP Error 403 When Trying to Login
- Advice on setting up private site
- Checking url from plugin [duplicate]
- How to programmatically detect how many posts are displayed per page?
- What plugin(s) are best for this User registration task? [closed]
- Trouble Removing Plugin [closed]
- Change All Login/Signup Links in Plugin
- How do I to override login redirect on specific pages?
- plugin for different writers [closed]
- selecting options from another form
- How to resolve these findings from security audit
- ERROR: Cookies are blocked due to unexpected output – no access to FTP
- How to Find WordPress site has backdoor login Codes
- How to create a custom wordpress plugin for a specific functionality?
- How to access values from your own settings page in javascript?
- Neither update_option nor delete_option fires in deactivation hook
- WordPress Homepage Login
- I cannot login after installing the wp-login timeout setting plugin
- wp_options Table keeps growing
- move setting data from wordpress api to codestar freamwork
- Multiple plugins settings of same developer into ONE settings page linked together
- When to store store plugin options as a single database record?
- How to fix a Wordfence scan that doesn’t finish?
- Issue: Unable to Access WordPress Admin and Database Errors
- Secure way to add JS Script to WordPress filesystem
- Custom Login and Password Reset for BuddyPress Website
- Is there a plugin or resource for custom implementation for OAUTH and regular user login?
- How to create WordPress login for different users, with different roles?
- Lost Password of my site, how to reset wordpress password?