For the moment, as a temporary fix, I have completely removed the Notifications.php file from
public_html/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications.php
You could create a template overload of this file:
bp-templates\bp-legacy\buddypress\members\single\notifications.php
Then wrap the current markup with this conditional: bp_is_my_profile()
Forgive me if I’m just making a mistake, I’ve never tried what you’re suggesting, in the link you sent me, it asks me to go to this directory,
/bp-templates/bp-legacy/buddypress/
But when I go there, there’s no Template file to copy, just more folders.
Thoughts?
The template files are in various folders.
Read the codex article carefully.
I was explicit about which file to use.
Ah, I see, I read it backwards to what you meant, thinking that was the 2nd file I had to use, and the first one I had to find. My bad.
Okay, now I’m getting somewhere, This is how I’ve set it up,
wp-content/themes/enfold(My theme)/community/members/single/notifications.php
It seems to be overriding the original file as it should be, the only problem now is that notifications disappear entirely(when clicking on the notification tab on the profile, there’s just a white space where the information should be popping up)
This is how I implemented your code,
switch ( bp_current_action() ) :
// Unread
case 'unread' :
bp_get_template_part( 'members/single/notifications/unread' );
break;
// Read
case 'read' :
bp_get_template_part( 'members/single/notifications/read' );
break;
// Any other
default :
bp_get_template_part( 'members/single/plugins' );
break;
bp_is_my_profile()
endswitch;
Now I’m not much of a coder, so I wouldn’t doubt that I’ve misinterpreted what you meant by “wrap the current markup”
Regardless, thanks for your help so far,I was lost, now I’m less lost. 🙂
Please use the code
button when sharing code.
Try
<?php
if( bp_is_my_profile() ) {
switch ( bp_current_action() ) :
// etc.
endswitch;
}
else
echo ' not allowed ';
Sorry, I’ll keep that in mind for the future.
This seems to have worked perfectly, thanks a bunch!