On any particular condition other than just messages? If you want to simply remove the item-header you have two choices really, query the page for the component and action being viewed and wrap a conditional around the item-header or using the template hierarchy create a index-messages.php file in your theme adding it into file structure as outlined in the codex guides ‘buddypress/single/members/’ now you can modify this template and remove elements just for that one component view.
Template Hierarchy
Thanks for replying. I was thinking of removing, later maybe having an alternate version, header for a number of pages. All messages, inbox, outbox etc. Also notifications, friend requests etc. Pages that will be private to you as a user.
I have run into something though, I can’t seem to make a hook work?
function testFunction() {
echo "Hello World!";
}
add_action(‘bp_init’, ‘testFunction’);
I’ve put this in /plugins/bp-custom.php which also have other functions that does work.
@duxortus in the code you’ve posted, your single quote marks look weird. Not sure if it’ll matter but they should really be like this:
'
Not like this:
’
I just figured that out, and yeah, that fixed it. Must have come from some code I copied. Sorry guys. Update on the members-header will follow!
For anyone wondering I am using a plugin widget I made in the sidebar for all user navigation.
For now I’m using CSS, as bp does it pretty easy for me:
body.my-account #item-header,
body.my-account #item-nav {
display: none;
}
body.my-profile #item-header {
display: initial;
}
@duxortus were you able to get the code for this worked out? I have WDS BP Framework and an not seeing where the members header is called for in messages.php so I figured I would try the former option Hugo mentioned.