I'm creating a customized WordPress theme based on an existing site.
I want to use an alternate dashboard which I have created.
How can I have the user directed to 'news.php
' after login instead of '/wp-admin/
' ?
--
EDIT: Have a working Plug-in for this but the bounty is still availible for anyone who can find a manual way to do this through functions.php, as it would be more secure then using a 3rd party plug-in.
The most common ways to implement redirection logic after login are: using HTTP Referer header. saving the original request in the session. appending original URL to the redirected login URL.
Go to 'Settings' in the WordPress admin menu and then click on 'Website Redirect'. Enter the URL you want to redirect the site to, set the desired redirection type, set the status to 'Enabled' and save your changes!
The quickest way to solve the WordPress login redirect issue is by clearing your browser cookies and cache. WordPress uses cookies to store authentication data. Sometimes your browser might retain old files, resulting in a redirect loop when you try to log in to your site.
To automatically logged user in (auto-login) and then redirect them to a custom page after registration, go to ProfilePress settings, open the Registration section and then check Auto-login after registration .
This should solve your problem. Adapted from an answer found here.
Add the following snippet of code in the functions.php file of your theme:
function admin_default_page() { return '/new-dashboard-url'; } add_filter('login_redirect', 'admin_default_page');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With