Thanks and it worked.
but its only show unread count on page load, but if user receive any message this did’t update.
the main purpose of this script is to display total number of unread messages and it should update via ajax means if user receive any message, it should show total total number of unread messages without reloading page.
i have bellow code in function.php of my theme
`<?php
function addMessageRefresh()
{
?>
function getMessages(){
jQuery(‘#user-messages span’).text(“Unread Messages: ()”);
}
setInterval(“getMessages()”, 10000);