How to hiding / redirect users page from non logged in users ?
Here the simple step to protect your WordPress BuddyPress member only pages. Add this simple snippet into your theme’s ‘functions.php‘ file. That’s it..
The below snippet sample will redirect the visitor if the visitor is not logged in & trying to visit the sensitive BuddyPress pages.
Will redirect non-logged-in users trying to access private content to your front page or home page
//Hide for non-logged-in users (public visitors)
function bp_logged_out_page_template_redirect() { if( ! is_user_logged_in() && is_page( 'members' )|| is_page( 'activity' ) || bp_is_user() ) { wp_redirect( home_url( 'https://vvcares.com/?buddypressBlogPostRedirect' ) ); exit(); } } add_action( 'template_redirect', 'bp_logged_out_page_template_redirect' );
Nice post. I was checking constantly this blog and I am impressed!
Extremely helpful info specifically the last part ð I care for
such info a lot. I was seeking this certain information for a
long time. Thank you and good luck.
It’s genuinely very complex in this busy life to listen news on TV, so I simply use world wide web for that
reason, and obtain the newest news.
I feel this is one of the so much vital info
for me. And i’m glad studying your article. But should observation on few normal issues, The web site
taste is great, the articles is truly nice :
D. Excellent job, cheers
I am in fact delighted to glance at this blog posts which contains plenty of useful data, thanks for providing
these data.
Hey There. I found your blog using msn. This
is a very well written article. I will make sure
to bookmark it and return to read more of your useful
info. Thanks for the post. I will definitely return.