title: Get User Subsite / Multisite URL in WordPress
body: <p>I am looking at a way to echo the url of the subsite of the user but it just seems to echo both the Network and Subsite of the account with the following function, what can I improve? Thanks!</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>// Add Shortcode
  function blog_url_shortcode() {
   if(is_user_logged_in()) {
    global $current_user;
    $blogs = get_blogs_of_user( $current_user-&gt;id );
    if($blogs) {
     foreach ( $blogs as $blog ) {
      echo '&lt;li&gt;&lt;a href="http://' . $blog-&gt;domain . $blog-&gt;path .'"&gt;' .  $blog-&gt;blogname . '&lt;/a&gt;&lt;/li&gt;';
     }
    }
   }
  }
  add_shortcode( 'blog_url', 'blog_url_shortcode' );</code></pre>
  </div>
  </div>
  </p>