It is a question previously answered and works still. The answer is here.
But I need something different. The code in the first loop redirects non-admins to homepage who tries to access admin profile. It means admin profile is already detected. I need non-admin to be directed to 404 page when they try to access admin profile.
I have found something like this on the web but I don’t know how to combine them. May someone help me?
I think It is a necessity for all BuddyPress users.
Thank you in advance.