Select from WordpressMU Posts


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. SELECT RECENT_POSTS.*, wp_users.display_name AS AUTHOR FROM
  2. (SELECT ALL_POSTS.* FROM
  3. (SELECT POSTS.*, post_author AS author_id FROM wp_2_posts POSTS WHERE post_status = ‘publish’ AND post_type=’post’
  4. UNION
  5. SELECT POSTS.*, post_author AS author_id FROM wp_3_posts POSTS WHERE post_status = ‘publish’ AND post_type=’post’) ALL_POSTS
  6. ORDER BY post_modified DESC LIMIT 0,20)
  7. RECENT_POSTS LEFT JOIN wp_users ON RECENT_POSTS.author_id = wp_users.ID

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.