Recent activity query WordPress
This needs to be 2 queries, one to get the posts most recently commented like: $q = “SELECT wp_comments.comment_post_id, wp_posts.* FROM wp_comments LEFT JOIN wp_posts ON wp_comments.comment_post_id = wp_posts.ID ORDER by wp_comments.comment_date DESC”; And one to get the most 10 recent posts by add or edit: $q = “SELECT * FROM wp_posts WHERE post_type=”post” OR … Read more