- This topic has 22 replies, 3 voices, and was last updated 2 months, 2 weeks ago by Tom.
April 22, 2020 at 10:03 am #1249585Carsten
Ohh, what a bummer, sorry about that, the message link is displayed now. Thank you very much.
The only thing missing is the message count, apperantly this part of the code, does not work.
The question is, if this is possible to achieve?April 22, 2020 at 4:00 pm #1250047TomLead DeveloperLead Developer
How is the count populated? Right now it’s just an empty element, so nothing will show. You would need to add a value in there for it to display.April 23, 2020 at 11:39 am #1251939Carsten
Hi there, I’ve got this information from a developer, but I don’t know how to add the user id to the function, can you help?
<?php echo bp_get_total_unread_messages_count( $user_id );?>
bp_loggedin_user_id(); // of the logged in user
bp_displayed_user_id(); // of the displayed user
bp_get_member_user_id();// in members loopApril 23, 2020 at 4:12 pm #1252310TomLead DeveloperLead Developer
You would have to put one of those functions in place of the
$user_idvariable in the first line.
Not sure which one, as I’m not familiar with the functions themselves.April 24, 2020 at 12:45 am #1252706Carsten
Thanks a lot for your help, the counter is working now.
The problem now is, how I integrate the counter with the menu item into one button?
Here is the markup:
<div class="grid-container sub-navigation grid-parent"> <ul> <li id="messages-personal-li" > <a href="https://domain/members/me/messages/" id="user-messages" class="menu-item menu-item-type-post_type menu-item-object-post messages-personal-li button"> Beskeder <span class="count"></span> </a> </li> </ul> </div> <?php echo bp_get_total_unread_messages_count( bp_loggedin_user_id() );?>April 24, 2020 at 4:07 am #1253044Carsten
Hi there, I think I got it.
Now only the styling remains
Thanks a lotApril 24, 2020 at 6:45 am #1253333Carsten
I want to add a search page with Page id 31017 to the secondary menu as well.
How do I add a page link, by URL or by page ID?
ThanksApril 24, 2020 at 9:41 am #1253785
- You must be logged in to reply to this topic.