Code:
SELECT wp_posts.ID
, wp_posts.post_content
, meta1.meta_value as meta_value1
, meta2.meta_value as meta_value2
FROM wp_terms
INNER
JOIN wp_term_relationships
ON wp_term_relationships.term_taxonomy_id = wp_terms.term_id
INNER
JOIN wp_posts
ON wp_posts.ID = wp_term_relationships.object_id
LEFT OUTER
JOIN wp_postmeta AS meta1
ON meta1.post_id = wp_posts.ID
AND meta1.meta_key = 'slot'
LEFT OUTER
JOIN wp_postmeta AS meta2
ON meta2.post_id = wp_posts.ID
AND meta2.meta_key = 'Read More Link'
WHERE wp_terms.slug = 'home-slideshow-mouseovers'
i made them LEFT OUTER JOINs as i wasn't sure if you wanted them mandatory... change to INNER joins if you do
i also took off your ORDER BY clause because it no longer made sense, feel free to add it back with the appropriate column(s)
Bookmarks