Wordpress Multisite User Admin Link

Hello,
I would like to know how I can create a link for a multisite user that has a site installed as a subdomain so that when he clicks on it, it will take him to his admin panel. Right now I tried the link below but it redirects him to the wordpress error page that says "Visit Dashboard" / "Visit Site". I would like it not to redirect him to that but his admin dashboard.

href="/wp-admin/admin.php". (Doesn't work because he has a subdomain)

How can this be done?

  • Rupok
    • Support Ninja

    Hi Brian, hope you had a wonderful day.

    Generally linking to subdomain subsite dashboard URL should do this. For example, if you have a subsite "sub.example.com", then subsite dashboard link will be "sub.example.com/wp-admin/" and it will take you to that subsite dashboard. But if it's not happening in your case, then I'm missing something and need to check your full configuration.

    I could tell you better about the way for doing this if I could see it live, check your current configuration and make some tests on your site. Would you mind allowing Support Access so we can have a closer look at this?

    To enable support access you can follow this guide here:
    http://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Have a nice day. Cheers!
    Rupok

  • Brian
    • WPMU DEV Initiate

    I understand that I could just add the link as sub.example.com/wp-admin/ but I don't want the link just for one subsite on my network but for all of them.

    For example:

    Dashboard Link (This wont work because "sub" is pointing to a specific site)

    I want it so that it allows anyone that has a site within my network to access their dashboard.

    Dashboard Link

    How can this be done with php?

    <?php
    if(is_user_logged_in()) {
    $user = get_current_user_id();
    $url = get_dashboard_url($user);
    echo 'My Dashboard';
    }
    ?>

    I want to insert this into my wordpress page but it won't allow me to insert php.
    Is there a way where I can configure my wordpress pages so that php can be run within them?

    Thanks.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.