This topic has 2 replies, 2 voices, and was last updated 11 years by girlinparis.

  • Author
  • #2183
     girlinparis
    Participant

    Hi guys. I run a multisite/buddypress site and use your theme. I want users to login to the main site but when they click on “dashboard” to be able to go to the dashboard of their primary blog. I found this in the wordpress codex and I think it is what I should use. Can you please tell me which file to place it into and where?

    <?php get_active_blog_for_user($user_id); ?>

    found here: http://codex.wordpress.org/WPMU_Functions/get_active_blog_for_user

    Thanks!

    Julie

    #2256
     SQadmin
    Keymaster

    Hi,
    You can’t use the just like that.
    To get the url this is the complete code to use. $url will have the blog link:

    COPY CODE
    
    
    $site_info = get_active_blog_for_user(get_current_user_id());
    if ($site_info) {
    	$url = $site_info->siteurl;
    }
    else {
    	$url = home_url();
    }
    echo $url;
    

    Then just echo $url where you need it.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #2258
     girlinparis
    Participant

    Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?