MYSQL query to grab featured image
-
Here is the query i wrote to grab thumbnails, but it doesn’t seem to be grab “featured image”. Can any one help ?
SELECT post.ID, post.post_title, post.post_content, attachment_meta.meta_value AS upload_relative_path FROM wp_posts AS post LEFT JOIN wp_postmeta AS post_meta ON (post_meta.post_id = post.ID AND post_meta.meta_key = '_thumbnail_id') LEFT JOIN wp_postmeta AS attachment_meta ON (attachment_meta.post_id = post_meta.meta_value AND attachment_meta.meta_key = '_wp_attached_file') WHERE post.post_status = 'publish' AND post.post_type = 'post' and post.id in( 8673)
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘MYSQL query to grab featured image’ is closed to new replies.