admin管理员组

文章数量:1414614

For my REST-API i need to get for every post the username, date ... and Avatar !

$query ="SELECT POST.ID, POST.post_title, POST.post_date, 
USER.user_nicename FROM 
    wp0x_posts POST INNER JOIN wp0x_users USER 
ON USER.ID=POST.post_author and POST.post_type='post' ";

The probleme that i have faced is that the avatars are stored in wp_posts , so i don't know how to call it for posts titles and call it again for users avatars

it would be much easier if the avatars were stored in wp_users :/

is there a way to get all these values in one query

POST ID 
POST TITLE 
POST DATE
AUTHOR 
AVATAR 

本文标签: wp queryHow to get user avatar via WPDB