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:
- How to add field for new site-wide option on Network Settings screen?
- Modifying a JS file with data from plugin settings
- Correct way to serialize the data of options table?
- Where should I use get_option in a plugin
- Change success message in plugin Theme my login
- 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 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?
- How can I make content disappear when a user logs in?
- Tracking last login and last visit
- How to fetch serialized data from wordpress options
- login to wordpress with Get variables instead of Post
- Changing widget options via the functions.php when there are no hooks
- Prevent Brute Force Attack
- Login with email (WP Modal Login)
- Check if the front end user is log in or not
- wordpress custom login successful redirect hook
- add function to saving change on Options Pages
- clean wp_options table unused rows
- How to set CORS header?
- Prepare plugin options for multi-lingual support
- Creating a plugin that will add options. Where should the options menu pages go?
- Add get_option to jquery
- wp_authenticate but not logged in
- update_user_meta add value on the top on existing value
- Set the active Navigation Menu from a plugin
- How do i login when i cant access wp-login.php?
- Where does WordPress store plugin (enabled/disabled) status for multisite?
- WordPress get_option and update_option returned entered on the textbox field
- Create mobile navigation header with settings integration
- Plugin: Google Analytics for Dashboard error – Timestamp is too far from current time
- Admin Theme customization
- How to save generated JWT token to cookies on login?
- changes to widget settings not showing up in individual pages pages until they’re updated [closed]
- Show admin notice on incorrect value on form field
- Contributive page where people logged in can write
- php page not found for plugin options menu
- add tabs in rdp-plugin/includes/settings.php and get settings saved
- wp_editor content in plugin options page
- Login cookies set as wrong domain
- Redirect to another page using contact form 7? [closed]
- Login Customizer doesn’t change the background of the register form
- Update a core option from plugin settings page
- update_option_{$option} not showing old value
- Login problem after installing my written plugin [closed]
- Can deactivating a plugin sometimes “reset” settings within that plugin?
- Plugin getting Cannot modify header information errors
- How to prevent plugins from sniffing/stealing other plugins’ options?
- Default plugin config to override wp_options?
- Possibility to login without password
- how do i change my website facebook login button to another text immediately user login? [closed]
- Update WP option by plugin
- WordPress unable to write files in the server
- How (or where) do I get wordpress plugin update download link?
- Adding option values as an array using a multi selectable select box
- Store plugin page content in wp_options?
- Custom PHP Page Using WordPress login
- If I use an alternative login (e.g. CAS or other SSO) plugin, is my site protected from the recent brute force login attempts?
- Need to add/remove group of options and display them as rows
- How to get values from network settings panel?
- How to add a custom form to a plugin’s setting page
- update_option creates an option, which empties on a blog reload
- Using call_user_func() within add_settings_section() within a Class
- Linking form to user meta fields
- WordPress Multisite Profile Picture Sync Error with Nextend Social Login Plugin
- Save log for imports in WordPress database – options-table, custom post type or other place?
- force logged in user to stay in the dashboard
- how to show new field if option selected?
- Creating an array from form inputs before it is posted to the options database
- Discern a specific plugin’s action hooks
- save short-code in my custom plugin settings problem missed something
- WordPress Admin login redirect to homepage
- https rewrite not working for All in one security Brute force > rename login url
- How to show private pages based on a user’s role?
- Enable plugins that are “not supported”
- Admin Custom Login loses settings on Code and Data migration
- Protect WordPress option value
- wp_signon returns user, in popup window, but the user is not logged in
- Why is the WordPress update_option not working in this code?
- wp_login_form() ignoring login_form action hook
- How to create a new database table whenever user changes options
- 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
- Create Array from data in the OPTIONS table
- wp-admin will not redirect to wp-login.php
- Error when renaming option
- Validating values using Settings API?
- Adding google authenticator and use only email address of user
- ‘all’ hook and get_option issue
- How to find an option in the database?
- How to programmatically detect how many posts are displayed per page?
- Change All Login/Signup Links in Plugin
- selecting options from another form
- How to Find WordPress site has backdoor login Codes
- How to access values from your own settings page in javascript?