Function/shortcode to display subsites directory or username (same)

I want to put a dynamic url on a page. The link is to another site of mine but with the same users. So it also includes the site admins same username. The same as the sub sites folder or sub directory.

Hoping you could help with a function so I could do this on the page.

I know some functions show only to logged in users but I want this to be visible to all, not just logged in users.

Thank you!!!

  • Ash
    • WordPress Hacker

    Hello @george

    I hope you are well today and thanks for asking the question.

    I am sorry I am not clear about your requirement. Please share a link of your current site, and a sample link that you want to make dynamic. Explain which part is the site admin username etc.

    Please let me know.



  • George
    • The Bug Hunter

    So here is one of my subsites, the directory/username is “legacy”

    Now I have another site with the same user/directory and want to link to the signup page which also has “legacy” in the url. The same user is on both sites.

    The all have a signup page I want to link to:

    So I would make a link like <a href=">[username]/signup"</a>

    Does that make sense?

  • Anang
    • New Recruit

    Hi George

    Trying to help here :slight_smile:

    So you have 2 site installations and both have same user right ? So is each installation only have one user ? And is this a wordpress installation using domain mapping or separately wordpress installation for each site ?

    Let me know more :slight_smile:

    Best Regards

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.