Hello! I need to display the list of users currently logged on the site, except for the user with user_id = 1 and user_name = guest. Tell me how to do it. I display a list of users with this code:
<?php $users_online = $wpdb->get_results("SELECT user_name, user_id FROM wp_useronline"); // Echo the title of the first scheduled post if ($users_online) { foreach ($users_online as $user_online) { echo $user_online->user_name . "\n"; } } ?>
I can not correctly make a condition to filter out user_id 1 and user_name Guest.