WordPress.org

Ready to get started?Download WordPress

Forums

Link to Primary Blog (2 posts)

  1. ktrusak
    Member
    Posted 1 year ago #

    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>
  2. TomCornar
    Member
    Posted 1 year ago #

    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]

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.