I need to add user profile to search results for a site we look after. I need to return any user with role of 'Consultant' (and only consultant) whos name or nickname or whatever matches the search request.
You can browse to a consultant page on the site which shows their details but I need it to be included in the search, and am finding it increasingly difficult.
I have tried writing a complex(ish) sql query to fetch out the user id's from the database where the first_name or last_name LIKE '%s%' and where the wp_capabilities is LIKE '%consultant%' which does work to an extend, but I don't know what to do with it now.
Any help is much appreciated.