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.
Or if you only want to redirect other users:
The Theme My Login plugin may help - it allows you to redirect users of specific roles to specific pages.
The accepted answer is clearly not a good answer! It may solve your problem for a while, but what will happen next time you update your wordpress installation? Your core files may get overridden and you will loose all your modifications.
As already stated by others (Dan and Travis answers), the correct answer is to use the
login_redirect
filter.This should solve your problem. Adapted from an answer found here.
The functions.php file doesn't have anything to do with login redirect, what you should be considering it's the wp-login.php file, you can actually change the entire login interface from there, and force users to redirect to your custom pages instead of the /wp-admin/ directory.
Open the file with Notepad if using Windows or any text editor, Prese Ctrl + F (on window) Find "wp-admin/" and change it to the folder you want it to redirect to after login, still on the same file Press Ctrl + F, find "admin_url" and the change the file name, the default file name there is "profile.php"...after just save and give a try.
Or you can use the "registration-login plugin" http://wordpress.org/extend/plugins/registration-login/, just simple edit the redirect urls and the links to where you want it to redirect after login, and you've got your very own custom profile.