Query pulling in Inherited posts
-
Hello,
I am currently trying to pull in certain posts with a publish status, I am having problems trying to get it to only post the posts that are the update version and not the 4 other revisions which accompany it.
here is my code
$querystr = " SELECT $wpdb->posts.* FROM $wpdb->posts, $wpdb->postmeta WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->posts.post_status = 'publish' AND $wpdb->posts.post_type = 'post' AND $wpdb->posts.post_date < NOW() ORDER BY $wpdb->posts.post_date DESC LIMIT 8,4"; ";
When this query runs, it gives me posts which hold the status inherit.
Is there anyway of stopping this?Thanks
- The topic ‘Query pulling in Inherited posts’ is closed to new replies.