Support » Networking WordPress » Link to Primary Blog

  • Having some problem with snytax, trying to make a link for users to go to their primary blog

    <?php $blog = get_active_blog_for_user( get_current_user_id() );
    $blog_url = $blog->siteurl(); ?>
    <a href="<?php return $blog ?>">Go to your Site</a>
Viewing 1 replies (of 1 total)
  • Try this Code,

    $userinfo = get_userdata($user->ID);
    $primaryblogurl = get_blogaddress_by_id($userinfo->primary_blog);

    Hope this helps.

    [sig moderated as per the Forum Rules]

Viewing 1 replies (of 1 total)
  • The topic ‘Link to Primary Blog’ is closed to new replies.