How To Link To The Correct User Admin Dashboard

Hi,

Here's how my log in proccess works for my multi site.

1. When a user logs in they will be redirected to a custom welcome page that I set up.

2. On that welcome page I provide some tutorial vdeos and a LINK to WP admin dashboard http://domain.com/wp-admin/

The problem is when they visit the link they are presented an error message:

You attempted to access the "Impact Instrument - Blogging For Marketing" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "Impact Instrument - Blogging For Marketing" dashboard, please contact your network administrator.

If you reached this screen by accident and meant to visit one of your own sites, here are some shortcuts to help you find your way.

Then there's the correct dashboard link below.

I don't want my users to see this error, how can I provide a link to the correct user admin dashboard on my welcome page?

  • Rupok

    Hi Eduard, hope you had a wonderful day.

    how can I provide a link to the correct user admin dashboard on my welcome page?

    You can get a list of all sites where currently logged in user belongs to, with the following custom code:

    <?php
    if(is_user_logged_in()) {
    global $current_user;
      $blogs = get_blogs_of_user( $current_user->id );
         if($blogs) {
         	 foreach ( $blogs as $blog ) {
             echo '<li><a href="http://' . $blog->domain . $blog->path .'">' .  $blog->blogname . '</a></li>';
    		}
         }
    }
    ?>

    So you can create a custom page template in your theme and put this code in the content area manually. Then you can redirect your users to that page after login.

    Please let us know if you have any confusion or if you are stuck at any point. We will be glad to help.

    Have a nice day. Cheers!
    Rupok

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.