有人知道如何从这个查询中排除pingback吗?我试图添加AND post_type = \'comment\'
之后AND post_password = \'\'
但这不起作用。
$query = "select
wp_posts.*,
coalesce((
select
max(comment_date)
from
$wpdb->comments wpc
where
wpc.comment_post_id = wp_posts.id
AND comment_approved = 1
AND post_password = \'\'
),
wp_posts.post_date ) as mcomment_date
from
$wpdb->posts wp_posts
where
post_type = \'post\'
and post_status = \'publish\'
and comment_count > \'0\'
order by
mcomment_date desc limit $limit";
新年快乐!即使您可能不知道答案;-)