I am working on a wordpress site where I have created a directory page(authors.php) that lists all users and certain author meta.
It works fine however I am trying to figure out how to only show users that have the required author meta filled out.
I've tried many different things but have not been able to achieve what I need. Here is my code
<?php $order = 'user_nicename'; $users = $wpdb->get_results("SELECT * FROM $wpdb->users ORDER BY $order"); // query users foreach($users as $user) : // start users' profile "loop" ?>
Everything else I try does not return any results. Is there a way to only select users with specific author meta fields filled out? Any help is appreciated, thanks.