redirect to user's main blog – MultiSite
-
I am trying to redirect users to their personal blog in Multisite.
I saw the variables:
[variable]username[/variable]
[variable]homeurl[/variable]
[variable]siteurl[/variable]
(and more …)The only one that works for me is “username”. Unfortunately some people might not have the same username as their blog so that won’t work.
I tried making my own variable but I kept getting an error.
Do you have any suggestions?
My Code:
$theUserName = rawurlencode( $user->user_login );
$theUser = get_user_id_from_string( $theUserName );
return get_blogaddress_by_id( $theUser );The Error message:
Cannot modify header information – headers already sent by (output started at … wp-includes/pluggable.php on line 876″Thanks!
- The topic ‘redirect to user's main blog – MultiSite’ is closed to new replies.