• Resolved virtualgeorge

    (@virtualgeorge)


    Which function would I use if I wanted to echo the path to the subsite or folder name and NOT the username?

    I have a site using this in a page template as “most” sites paths match the username but if the path & the username are different? Whats the best alternative? It will be displayed for “logged in” users.

    - <a href="https://bizconnect360.com/<?php echo $current_user->user_login?>">Your Website</a>

    Thanks!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    You could, at best, echo the path to the current site, but not the user’s site, for one very obvious reason. Without the user logged in, you have no way to know what the path will be ??

    If you’re using subfolders, though, logging in on the main site SHOULD redirect them to their site.

    Thread Starter virtualgeorge

    (@virtualgeorge)

    It is only displayed for logged in users and the code is used for other links for example and about us page would be:
    user_login?>/about-us”>About Us

    So it populates the logged in users username creating a link to the about us page. However, I need to echo the path to the sub-folder.

    I pretty sure I have seen a function that gets the site url or blog info or something like that in another thread but can’t find it now or remember which it was:)

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Ah sorry, I thought you were asking how to detect that for a login link…

    get_blogs_of_user( $user_id );

    That would list all their blogs.

    get_active_blog_for_user may be the one you want.

    Thread Starter virtualgeorge

    (@virtualgeorge)

    Thanks again ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Echo path to sub-site or blog on multisite ?’ is closed to new replies.