Check that your are on the home page, and that the user is logged in, and redirect if both are true:
function redir_user_wpse_187622() {
if (is_home() && is_user_logged_in()) {
$user_id = get_current_user_id();
wp_safe_redirect(get_author_posts_url( $user_id));
}
}
add_action('template_redirect','redir_user_wpse_187622');
Related Posts:
- Redirecting to home-page when saving any edited code
- Random and Erroneous WordPress Redirect
- All pages showing up as homepage on WordPress website
- https multiple redirects
- Redirect home to another page with htaccess
- How can I redirect my website’s homepage to a random blog post?
- How to redirect to home page after registration?
- How to set up a single portfolio page as home page?
- Any action in wordpress redirects me to home page
- How can I replace my primary url globally with a parked one?
- Extra Text in URL
- Redirect /home to home.php
- How to redirect all page requests to a single “goodbye” homepage? [duplicate]
- Add new post redirection [closed]
- How to Redirect WordPress domain.com/?anyword to 404 Page?
- How do I redirect the browser to 404 page, if no posts are found in home page
- Site using static homepage, redirects (301) and removes pluses from query string
- How to get user details by name
- After disabling Multisite, homepage redirects to non-existing page
- One set of Child Pages redirecting to Home page?
- WordPress Redirecting Form Action to Home Page
- How do make WordPress to let alone my static home page?
- Make category page the wordpress homepage (not blog)
- Redirect Restricted Page to 404
- Redirect user to original url after login?
- Redirect to dashboard after login
- Make a video post redirect to next post after completion
- Redirect blog page to latest post?
- WordPress site redirects to different wordpress domain on the same server after reuploading db backup
- WordPress Redirect based on the prescence of a cookie
- Links to an exisiting Page are now redirecting to a draft page?
- Redirect Old domain & posts to new domain homepage
- Redirecting users to referrer page after logging in using custom login form
- add_rewrite_rule to pass entire path as a single parameter
- What is the wordpress way of displaying local external content?
- Menu links only using http after enabling https, unable to redirect http links
- Return to where the user was, after log out
- Change ‘Back To Website’ link in wp-login.php
- How do I map a subdomain in wordpress to the primary domain in a multisite setup?
- Redirect the non-www version of the site to the www
- Load time cost of using a redirect plugin v direct .htaccess entry
- Intercept the “lost password” action by first redirecting to an existing instructions page
- How to pass email values from one php page to another
- How to redirect after login getting a variable from url (for example with the language)
- How to set 301 redirection after moving WordPress blog?
- How to include error message on login
- How to use a custom domain?
- WooCommerce unexpected behavior [closed]
- Force WordPress to load from site’s hostname
- How can I force the user to log in, even if they’re already authenticated?
- 301 redirect instead of 404 when URL is a prefix of a post or page name?
- Redirect users after register (first login) and force submit post
- How to pass a message using template_redirect
- .htaccess 301 redirect conflict with plugin “WordPress Https”
- Disable WordPress URL auto complete
- Problem in disabling canonical 301 redirect
- Prevent users from going to wordpress profile after login
- How to redirect just one or two blog posts correctly?
- Force WordPress https redirect before www redirect based on site address url
- Prevent wordpress autoredirect
- Custom form redirect after login
- How to redirect only 404 pages with htaccess in WordPress
- How to redirect the frontend of a WordPress site (only)?
- My site is being redirected to itself
- Redirect Attachment Page to Attachment
- Permalinks do not include www subdomain
- Redirect away from page if user is not admin
- Redirect users after login
- redirect to a child theme based on the town of Internet users in france with the verification of the ip address
- Redirect to parent page if child does not exist
- Change the domain url?
- Redirect current user to their most recent custom post
- how redirect users to custom login page when “login to reply” is clicked? [duplicate]
- After retrive password, redirect to index page
- Change Category Slug Redirection
- custom login form redirect problem
- Bulk redirect all post
- Disable redirect to homepage after successful Login, Stay on Current Page
- WordPress no permission redirection to a popup
- Open wordpress page in directory the way index.html would open
- How force WordPress redirect to current custom page after login
- Redirect Homepage to another page when user login
- Determine user destination on wp-login.php
- 301 Redirect in WordPress not working in htaccess
- Toggle Redirect Function On/Off With Checkbox
- My wordpress site has “https://” on it but when I go to Dashboard and click visit site, it removes the “https://”
- redirect to https://my-site/wp-admin/ instead of https://my-site/wordpress/wp-admin/ after options updating
- Redirect after login when WordPress in subdirectory
- All links redirecting to homepage
- How to redirect non-admin/editors from specific pages?
- How to make a redirect link in wordpress?
- wp_redirect leading to an infinite loop
- Redirect after Permalink change – What regex do I use?
- Redirect based on $_GET parameters
- redirect users to the login page
- Moving an ASP Site to WordPress – Looking for Help on Redirects
- How to setup an automatic redirect for when there has been a critical error on the site?
- How to force HTTP and stop SSL completey on WordPress website
- How to Setup 2 Domains on a Single WordPress (Regions Filter)?
- WordPress keeps redirecting to root site after saving any setting