Functions.php specific redirection
-
Hello,
I’m trying to create a function which redirect users logged in with a specific role when they click on my logo which usually drive to my homepage.
Here is my code (I’m a rookie):
/* test */ function employeur_home() { if (in_array('employer', $GLOBALS['current_user']->roles) && is_front_page() ) { wp_redirect( get_permalink( 1166 )); exit(); } } add_action('init', 'employeur_home');=> I want employers to be redirected on my page ID 1166 instead of the homepage when they click on my logo.
It doesn’t work. They can still go to my homepage.
Can you help me ?
Thanks a lot.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Functions.php specific redirection’ is closed to new replies.