Can’t display user bio

I’m not certain as I have no experience of ACADP, but I suspect your problem is the function, acadp_get_user_slug. What does it do? Likely not what you think! As the following will work for the user admim: function display_user_bio() { $user_slug = ‘admin’; if($user_slug != ”) { $user = get_user_by(‘login’, $user_slug); if($user) { return get_the_author_meta(‘description’, … Read more

Query a meta key using an array of values where the database value is a string

You could use multiple meta clauses in your WP_User_Query, along with a LIKE comparison. Something like $args = array( ‘role’ => ‘member’, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘specializations’, ‘value’ => ‘doctor’, ‘compare’ => ‘LIKE’, ), array( ‘key’ => ‘specializations’, ‘value’ => ‘researcher’, ‘compare’ => ‘LIKE’, ), ), ); $found_users = new … Read more

User’s Comments Number: Storing it in a meta field for different uses

I am using this within a plugin, but it can be used within your theme’s function file. // Create field to track users’ comments numbers function display_educadme_user_comments_number($user_id) { if( is_user_logged_in() ) { global $wpdb; $user_comments_number = $wpdb->get_var(‘SELECT COUNT(comment_ID) FROM ‘ . $wpdb->comments. ‘ WHERE comment_author_email = “‘ . get_comment_author_email() . ‘”‘); ?> <h3><?php _e(‘Participation in … Read more