Forum Replies Created
-
Author
-
DaveKineticParticipant
I have the same issue. Would really like to have the menu available on all pages.
DaveKineticParticipantSorry, another strange one. The top menu does not display on Buddypress pages. I’ve got it set to show. Any idea where this has gone?
DaveKineticParticipantI found a tutorial here. My menu is called top-menu
Copied his code (I think) and came up with this:
COPY CODEif ( is_user_logged_in() && $args->theme_location == 'top-menu') { add_filter('wp_nav_menu_items','add_notification_to_custom_menu', 2, 2); function add_notification_to_custom_menu( $items, $args ) { $notifications = bp_notifications_get_notifications_for_user( bp_loggedin_user_id() ); $count = ! empty( $notifications ) ? count( $notifications ) : 0; if ($count > 0 ) { $alert = 'alert'; $pending = 'pending-count'; } else { $alert = 'no-alert'; $pending = 'count'; } return $items."<li id='menu-bp-notifications' class='menupop'><a href='".bp_loggedin_user_domain()."notifications/'><span id='ab-pending-notifications' class='" . $pending . " " . $alert . "'>".$count."</a></li>"; return $items; } }
That removes the bubble from both though. I know sharmstr is busy, so maybe someone else can see where I am going wrong.
DaveKineticParticipantSorry to be annoying. Anyway to exclude it from the main menu and only show it in the top menu?
DaveKineticParticipantI really want to use this addition, but when I use it i get the following error:
Parse error: syntax error, unexpected T_STRING in ../wp-content/themes/kleo-child/functions.php on line 29
The code on that line is
return $items."<li id='menu-bp-notifications' class='menupop'><span id='ab-pending-notifications' class='" . $pending . " " . $alert . "'>".$count."";
DaveKineticParticipantI’ve put in the text and everything is fine. One thing I can’t understand is how have you set it so the home page has a black transparent background behind the menu that only appears on scroll, and then all the other pages have a solid white background on the menu.
-
AuthorPosts