Skip to:
Content
Pages
Categories
Search
Top
Bottom

Remove notification count unless there is 1 or more notifications pending?


  • etherene
    Participant

    @etherene

    Hey there.

    I’m trying to figure out the code that will make the notification count in the admin bar only appear once there is at least 1 notification pending. Right now (as you can see even here on this page) it shows up as 0 notifications when there are none. I don’t want it to show the count as 0, I want the count to be completely gone until a notification comes up (à-la facebook, twitter, etc).

    I’m not using the default admin bar, I’ve implemented the notification item into my template’s custom header. I believe there could be a code I can add into my functions.php file to make this happen?

    Thanks in advance!!

Viewing 1 replies (of 1 total)

  • Jonas
    Participant

    @jonaskjodt

    Hi,

    you can control whether or not to show the alerts through their css classes.

    I’m guessing you’ve copyied Buddypresses way of notification alerts to your own template’s custom header, something like this svn.buddypress.org/branches/2.0/bp-notifications/bp-notifications-adminbar.php

    0 notifications is governed through the .no-alert class – and whenever more than 1 notification is shown, it’ll have the .alert class.

    So you could do something as as simple as writing .no-alert {display:none} in your css stylesheet.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar