wp query - How to get user avatar via WPDB

For my REST-API i need to get for every post the username, date ... and Avatar ! $query ="SELECT POST.ID, POST.post

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 

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745182361a4615476.html

相关推荐

  • wp query - How to get user avatar via WPDB

    For my REST-API i need to get for every post the username, date ... and Avatar ! $query ="SELECT POST.ID, POST.post

    5小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信