[Resolved] Adding elements to a Sub Nav Element

Home Forums Support Adding elements to a Sub Nav Element

Viewing 8 posts - 16 through 23 (of 23 total)
  • Author
  • #1249585

    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.
    <span class="count"></span>

    View post on imgur.com

    The question is, if this is possible to achieve?

    Lead Developer
    Lead 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.


    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 );?>

    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 loop

    Lead Developer
    Lead Developer

    You would have to put one of those functions in place of the $user_id variable in the first line.

    Not sure which one, as I’m not familiar with the functions themselves.


    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?

    View post on imgur.com

    Here is the markup:

    <div class="grid-container sub-navigation grid-parent">
            <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>
    <?php echo bp_get_total_unread_messages_count( bp_loggedin_user_id() );?>

    Hi there, I think I got it.

    View post on imgur.com

    Now only the styling remains

    Thanks a lot


    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?


    Lead Developer
    Lead Developer

    If you have the URL, I would add it by URL so it’s more human-friendly 🙂

Viewing 8 posts - 16 through 23 (of 23 total)
  • You must be logged in to reply to this topic.