Add below code in your functions.php file of active theme directory in order to restrict the login page to logged-in users and redirect them to core user page (user profile). You can replace “um_get_core_page( ‘user’ )” with any page URL where you want to redirect logged-in users.
/* Restrict Login page to logged-in users and redirect to core user page (user profile) */
add_action( 'template_redirect', 'um_restrict_login_page_logged_in' );
function um_restrict_login_page_logged_in() {
if ( um_is_core_page('login') && is_user_logged_in() ) {
wp_redirect( um_get_core_page( 'user' ) );
exit;
}
}
Hope this works!!
Related Posts:
- Masking logout URL
- Logout/login redirect CSS issue
- Paged Single Post doesn’t redirect to the main url after Removing Pagination
- redirect wp-login.php to another page
- How do I redirect upon login a specific user based on role?
- Ninja form Redirect depending on text field content [closed]
- Redirect specific page in WordPress for first time visit
- How do I redirect all 404 error url to Subcategory url
- 404 redirect to previous category
- Login Redirect if Logged in from Specific Page
- Redirect to another page if the user is logged in when pressing again the login button on menu bar
- Incorrect redirect after commenting
- How i can put $_GET codes in function.php?
- Why does get_template_directory_uri() not include “www”, only for enqueued stylesheets?
- Page get parameter doesn’t work with is_single() function
- Redirect website domain (including all pages) to external URL after Popup message (few seconds)
- Contact Form 7 If Condition
- Solved: redirect to another page using functions.php
- Logout Redirect and also WP-login.php Redirect
- How to add array [closed]
- WordPress website keeps loading the maintenance page
- Redirects based on a JSON file
- template_redirect action only firing if logged in
- How to redirect Subscribers on login to specific page, when logging in from a Page
- Redirect to one of two pages after data submitted, depending on the current url
- Wildcard 301 Redirect Using Theme Function
- Competing Login Redirects – Need to be Combined?
- Postback redirect through add_action is not triggered
- Restrict access if logged out except for homepage
- Redirect specific author posts to another url
- Custom download page
- How to create a function to redirect a specified page to another page
- Language switcher for subdomains
- Allow the access over wp-login.php
- How to request login for user but not for bots
- Making an under maintenance page (without using plugins)
- Template Redirect Function Only Working When Logged In
- Disable Attachment Page Except for Category
- How to check if a user exists by a given id
- Redeclare a function in a child theme
- How can I programmatically create “child” pages on theme activation?
- Add admin bar link to edit author
- How to include one class/instance without using global variables
- Modify search function in WordPress (TwentyTwelve)
- Show/hide Widgets in Dashboard Based on Current Advanced Custom Fields Option
- How to Acheive the custom woocommerce category template
- How to add CSS style sheet dynamically in wordpress
- How to update BuddyPress xprofile fields programmatically? [closed]
- Replace Archive Widget Link Text
- A snippet after every image
- Programmatically set page template based on page ID
- How can I add an image field to BuddyPress Extended Profile Fields? [closed]
- wp_remote_post with ssl:// protocol
- How to include local menu based on page id?
- How to add custom fields to my custom registration form
- Custom Taxonomy Permalinks Redirection
- How can I change the do_action function in footer (copyright area)
- How to display post content instead of excerpt
- Override a theme function in a child theme?
- changing behaviour of get_search_form
- Which action does wp_update_user triggers?
- Include default functions and methods
- Dynamic dropdown from database table
- Functions in custom theme
- Please Explain the Importing Process of Multiple Stylesheets for Child Themes
- check if author has published posts in custom post type, then send mail
- paginate_links() don’t properly work in search.php?
- What’s wrong with my use of plugin_url()?
- How can I modify the element on all pages?
- AMP – Change rel=”canonical” from functions.php [closed]
- Function filter breaking tag archive menus
- How to echo the value of an array element using a function via a shortcode
- Create short URL with auto 301 redirect
- Where is this JQuery coming from?
- Different favicon on different pages
- What is the better for call files: bloginfo() or echo esc_url()?
- Setting Permalinks in wp_config or functions file?
- loginout function customization
- Dashboard blocker on network multisite for specific user roles
- How to place a div inside a function that creates a div
- Echo post title in post
- dynamic enquiry form [closed]
- How would I make a function to dynamically determine if user is logged to change navigation menu text?
- How to change images url in function.php?
- Which filter fires upon setting a featured image
- Probleme shortcode with list author
- Stylesheet does not load despite functions.php
- How to show only specific category post by user role without plugin and restrict all other cats
- Shortcode to output category description by passing ID
- Unable to declare AOS library in functions
- Removing sanitize_title_with_dashes Function with The Real Title
- Graphic before title – Specific Category
- Printing medium sized image
- redirect 301 with special character like WIX site “#!”
- WordPress Jquery+scripts enqueue issue
- Adding a jQuery rotator function
- How to programmatically GET (to know) which Sidebar (or) which Menu is being used on Different Pages?
- Can’t change excerpt length and more tag
- Image width issue in IE [closed]
- Changed functions.php file and now site is blank [closed]