Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @aldoy

    You can try this shortcode [um_online_users_count]

    Add this to your theme’s functions.php file or use Code Snippet plugin:

    add_shortcode("um_online_users_count", function(){
      if( ! class_exists("UM_Online") ) return;
    
      $users = UM()->Online()->get_users();
      $total = count( $users );
    
      return "Total Online Users: {$total}"; 
    
    });
    • This reply was modified 3 years, 8 months ago by Champ Camba.
    Thread Starter Hasan

    (@aldoy)

    Thank you, that should work perfectly but the shortcode doesn’t get replaced. Any idea what else I can do to register that shortcode? (I’m on the latest version)

    Wouldn’t the UM online users plugin work to do this as well?

    Thread Starter Hasan

    (@aldoy)

    It does not show the Total Number of displayed online users.

    The only way it worked for me is to override the online.php to increment a counter in the building loop of users.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Total Number of Online Members’ is closed to new replies.