HOW TO GET THE URL/PATH OF CURRENT USERS SITE
-
Hi, I am working on a multi-site which I have setup with sub-directories and not sub-domains. I am trying to create a link that will take the current logged in user to their site url with a page name added to the end.
For example, the user will login and do everything on the main site but then there is a page that will be the same for everyone, just different prefix before the “/” — Im not sure if I worded that correctly. Here is what I have, maybe it’ll explain a little better —
<a href="<?php $blog = get_active_blog_for_user( get_current_user_id() ); $site_url = $blog->path ?>/upload-document">Upload Documents</a>
So if the user site is example.com/user, then I would like to be able to dynamically echo their site path with “/upload-document” added to the end.
How can I correctly do so? Any help is appreciated. Thanks.
- The topic ‘HOW TO GET THE URL/PATH OF CURRENT USERS SITE’ is closed to new replies.