Member Only Theme
I was looking at other people’s solutions for making a buddypress community member only and really came to one conclusion. It will be best served when the components are added That being said, I was looking at the seriously easy hacks due to the high volume of SVN updates being made. The simple one I was looking at was doing the following in /buddypress-member/header.php right at the top of the file :
header("HTTP/1.1 302 Moved Temporarily");
header('Location: ' . get_settings('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']));
header("Status: 302 Moved Temporarily");
Just putting that at the top of the file would redirect any request to buddypress-member theme back to the login page if not logged in. While there are most likely better ways to do this, I was looking for a simple one copy and paste type edit when things change.
My questions about this are:
1) Is there a more efficient way to do this without multiple hacks to multiple files?
2) If this is a good way, is there an easy method to add the text “You must login to view member profiles” to the login that I am redirecting to as well as a link to the wp-signup.php page?
You must be logged in to reply to this topic.