show unread message counters | WordPress.org

[ad_1]

Hi

I want to show unread message counters in an element of elementor

I find this soloution in your website:

Sometimes you need to create custom unread messages counter at your website.

This is example of jQuery code snippet to make counter display messages count dynamically:

<script type=”text/javascript”> jQuery(document).on(‘bp-better-messages-update-unread’, function( event ) { var unread = parseInt(event.originalEvent.detail.unread); if( isNaN ( unread ) || unread < 0 ) unread = 0; var messages_count = jQuery(‘.header-notifications.user-messages span’); if( unread > 0 ){ messages_count.text(unread).attr(‘class’, ‘count’); } else { messages_count.text(unread).attr(‘class’, ‘no-alert’); } }); </script>

I used this code in a html element but not shows any counter

How can I have counter?

Best Regards

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer