Forum Replies Created
-
If the code is not working for you then you can try the following plugin
WP Change Default Email —-> https://wordpress.org/plugins/wp-change-default-email/
Hope it helps 😀
Thanks for the replies. I would check the solution.
And do you guys know anyway to remove my activities from the site-wide activities?BUMP!
Thanks for the reply but when I am adding this code to functions.php file the image upload plugin I am using is not uploading the pictures. 🙁
That works exactly the way I wanted. Thank a lot
Try to add it to your theme’s function.php file instead of bp-custom.php
Try This Code :
add_action( 'wp', 'custom_lockdown_redirect', 3 ); function custom_lockdown_redirect(){ global $wp; if (!is_user_logged_in()){ if ( bp_is_activation_page() || bp_is_register_page() || ( in_array( $GLOBALS['pagenow'], array( '/login' ))) ) return; bp_core_redirect(get_option('http://yoursite.com') . "/login"); exit; } }
Make sure the you change
/login
with your login link.Add it to your theme’s function.php file
The only plugin I know is this one —> BPDEV Username Availability Checker
In 1st point, I am talking about the web browser of a mobile phone… missed it by mistake.
Thanks
WOW!!!
Thanks a lot Brajesh!
You solved my problem and this is exactly what I wanted.Thanks a lot. I really appreciate your help.
Have a nice day!And also it is showing notification of the users of whose profiles I visit. I just want the notification of the currently logged in user…
Thanks
@danbp
I have edited the code a bit and now it is getting displayed on all the pages as I wanted but, How can I hide the modified title when the notification count is 0. By current code is below –function bpfr_add_notification_to_page_title( $title, $original_title, $sep, $seplocation ) { global $bp; if( bp_is_user() && ! bp_get_member_user_id() ) { $user_id = 'displayed: '. bp_displayed_user_id(); } else { $user_id = 'get_member_user: '. bp_get_member_user_id(); } if (bp_notifications_get_unread_notification_count( $user_id ) ) { $counter = 0; for ( $i = 0; $i < count($notifications); $i++ ) { echo $notifications[$i]; $counter++; } $title = "You Have " . bp_notifications_get_unread_notification_count() . " New Notification(s) - "; return $title; } } add_filter( 'wp_title', 'bpfr_add_notification_to_page_title', 9, 4 );
Thanks
The code works but only on profile pages. Can this come on each page including the home page…
Thanks a lot for your help! 😀
@henrywright
No.. You can look at the screenshot belowI tried using the below code but it is returning the value to zero too 🙁
echo bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );
Thanks for the reply but
I used the below code to print the notification count on my page to match it with the notification count which is shown by wordpress and I noticed that the below code returns the value to zero no matter what ever the original notification count is.
echo bp_notifications_get_unread_notification_count( $user_id );
and yes I need unread notification count.
count($notifications) is returning the value to ‘1’ no matter whatever the notification count is…
Thanks for the answer but, what is the notification count in this code? I mean, what would be the term that I would use to compare with ‘0’.
if ( what_do_I_keep_here >0) { // Some action here }
Thanks
I think the word ‘Title bar’ might be confusing. By, title bar I mean, ‘Title of the page’ the one that gets displayed on the title bar of the web browser.
Thanks
Just ignore the other question that I asked. I got it figured out.
Thank you so much for your help. Have a great weekend.
Thanks! 😀
@henrywright
By single link I mean. Like, example.com/me/ redirects to the username of the person who is logged in. Now, I can just put this example.com/me/ link anywhere and it would redirect to the respective username of the people. This is what I mean by single link….I edited the code and now it is working as it should be. So, the final code is –
function my_redirect() { if ( is_page( 'me' ) && is_user_logged_in() ) bp_core_redirect( bp_loggedin_user_domain() ); } add_action( 'wp', 'my_redirect' );
I have replaced
add_action( 'template_redirect', 'my_redirect' );
with
add_action( 'wp', 'my_redirect' );
Thanks for your help, @henrywright & @shanebp
Just wanted to ask another question. If I want a single link to redirect to other things like notifications, then all I need is to do is this right,
bp_core_redirect( bp_loggedin_user_domain() . '/notifications' );
Thanks!