Tagged Questions
0
votes
0answers
24 views
Reduce number of SQL queries inside WP_Query loop to fetch author data
This question applies to scale and does not concern typical blog implementations. I'm working on a web app where I'm running standard WP_Query to fetch some custom post types. This usually results in ...
0
votes
1answer
64 views
Getting list of top 10 users and sort on last name
I would like to display a list of the top 10 authors based on the amount of posts that they have, and then sort them on last name. To my knowledge, this is not trivial since the last name of a user ...
0
votes
1answer
68 views
get random users each time based on the meta key
I have many users on my website, out of some has status "elite". I am saving this status in meta key/value for each user ('meta_key' => 'elite_member', 'meta_value' => '1').
I want to display ...
1
vote
2answers
111 views
How may I filter get_users() similarly to pre_get_posts?
I have filtered posts, pages and custom_post_types based on $current_user custom usermeta field values using pre_get_posts().
Is there a similar method/function to alter get_users() based on ...
0
votes
1answer
86 views
Echo text if field under user_meta is empty with get_users()
With get_users() I am listing users and their information. I've a custom field in the database, people_lists_class.
<?php
$blogusers = get_users('role=contributor&orderby=display_name');
...
0
votes
2answers
401 views
How to get the user description with get_users?
I'm using this piece of code to list users and their information. The problem I'm having is that the description isn't showing. Obviously it's because the description lays under "user_meta" and not ...
0
votes
1answer
443 views
Return all users with a specific meta key
I'd like to use get_users() to return all users that have a particular meta_key, but I don't want to specify what the value has to be because it will change for every user. The value is a json string. ...
-2
votes
1answer
97 views
Get all user with both meta_value
I was wondering if there were any efficient way of fetching all user comparing two different meta_key. I am currently fetching all user compared to the first meta, then loop trough the user_id to ...
0
votes
1answer
343 views
get current user not working
I was trying this code to get current user info, but showing nothing. My WordPress version is 3.3.1
<?php
wp_get_current_user();
/**
* @example Safe usage: $current_user = ...
5
votes
2answers
423 views
get_users is expecting unserialized meta_value
I'm trying to get all users assigned to a custom usermeta. I know that get_users() is supposed to work; however, it doesn't seem to be working. What I have is a usermeta storing a category ID and I'm ...
1
vote
1answer
2k views
Getting all user metadata from user
I am trying to show bio and other custom metadata for my users in a page. So, i want to query the user metadata table for it. I have tried but did not find any functions for that.
What i am looking ...