Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is possible to have a direct access to the site when log in? I mean, when you log in, you access to the WP editor page. I want that user of my site will directly forwarded to the site.

share|improve this question
    
What do you mean exactly? Do you want them to be redirected to the Articles dashboard page? Or to the Pages dashboard page? Or to altogether create a new article or page? –  Sunyatasattva Mar 19 '13 at 16:25
    
No. I want that the homepage of the site is shown. –  the_candyman Mar 19 '13 at 16:33
add comment

1 Answer

That is pretty straight forward, you use the login_redirect filter hook which is there for exactly this case.

You would add something like this to your functions.php file:

function home_login_redirect( $redirect ){

    // Check if user is administrator; you probably want to redirect
    // him to the dashboard, don't you?
    if ( current_user_can( 'administrator' ) return $redirect;
    else return home_url();

}

add_filter("login_redirect", "home_login_redirect");
share|improve this answer
    
thank you very much! but I cannot access to functions.php (actually, I cannot access to the file system which hosts the site). I can only execute php code by using some suitable plugin. –  the_candyman Mar 19 '13 at 16:54
    
If you have administrator permissions you can always access the functions.php file through the dashboard. Just go to Appearance > Editor from there, on the right side, you will see the functions.php. –  Sunyatasattva Mar 19 '13 at 16:56
    
At the end of editor page, I have the following: "You need to make this file writable before you can save your changes. See the Codex for more information." –  the_candyman Mar 19 '13 at 17:13
    
And did you read the Codex for more information? Anyhow, are you sure you cannot access the host? That's very weird. If so, you are basically asking a plugin recommendation, which is off-topic on this site. Also, if really so, your question answers itself with a simple Google search: here's the first match wordpress.org/extend/plugins/custom-login-redirect –  Sunyatasattva Mar 19 '13 at 17:20
    
The site is hosted by the server of my department. Their policies does not allow access to the filesystem to external people. –  the_candyman Mar 19 '13 at 19:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.