- 
	
	jbarr posted on the forum topic I Need Help Writing A Custom Function to Redirect Non-Logged in Users. in the group How-To and Troubleshooting: 15 years, 6 months ago Sorry for the confusion. In testing, I reverted back to the stock, default theme to make sure there wasn’t anything else at issue. That worked, so I then made the update to functions.php and header.php in the Cosmic Buddy directory, and it now works properly. Fortunately, I’m doing all this on a test install, so […] 
- 
	
	jbarr posted on the forum topic I Need Help Writing A Custom Function to Redirect Non-Logged in Users. in the group How-To and Troubleshooting: 15 years, 6 months ago Ok, I got it to work. I added this… function sh_walled_garden() 
 {
 global $bp;
 if ( bp_is_register_page() || bp_is_activation_page() )
 return;
 if( ! bp_is_blog_page() && ! is_user_logged_in() )
 bp_core_redirect( $bp->root_domain .’/’. BP_REGISTER_SLUG );
 }
 add_action( ‘walled_garden’, ‘sh_walled_garden’ );…into…[Read more] 
- 
	
	jbarr posted on the forum topic I Need Help Writing A Custom Function to Redirect Non-Logged in Users. in the group How-To and Troubleshooting: 15 years, 6 months ago As far as I recall, everything is “stock” except for me inserting the above function code into the end of the /wp-content/themes/cosmicbuddy/functions.php file. Should I be adding the function code to the functions.php file in the /wp-content/themes// directory? 
- 
	
	jbarr posted on the forum topic I Need Help Writing A Custom Function to Redirect Non-Logged in Users. in the group How-To and Troubleshooting: 15 years, 6 months ago Just to clarify, the function code above is added to the functions.php in the theme’s directory (for example, /wp-content/themes/cosmicbuddy/) and NOT in the /wp-includes/ directory, correct? 
- 
	
	jbarr posted on the forum topic I Need Help Writing A Custom Function to Redirect Non-Logged in Users. in the group How-To and Troubleshooting: 15 years, 6 months ago The source is here: http://pastebin.com/LSghtFLW The added function is at the bottom. I am using the CosmicBuddy BP theme. 
- 
	
	jbarr posted on the forum topic I Need Help Writing A Custom Function to Redirect Non-Logged in Users. in the group How-To and Troubleshooting: 15 years, 6 months ago when I add the function to functions.php in my theme directory, when i navigate to any page of my site, it just comes up blank. Suggestion? 
- 
	
	jbarr posted on the forum topic I Need Help Writing A Custom Function to Redirect Non-Logged in Users. in the group How-To and Troubleshooting: 15 years, 6 months ago It looks like you have a solution, so for those of us who need some additional coaching, can you please explain how to implement it? I just love what BuddyPress has to offer, however for privacy reasons, on the site I’m developing I need to hide several components like “Activity” and “Members” when a visitor […] 
- 
	
	jbarr joined the group How-To and Troubleshooting 15 years, 6 months ago 
	@jbarr
	Active 1 month, 1 week ago