最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wp query - How to get user avatar via WPDB

programmeradmin0浏览0评论

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 
发布评论

评论列表(0)

  1. 暂无评论