Wordpress. Select posts woth not something meta_key


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



Copy this code and paste it in your HTML
  1. $request = "SELECT ID, post_status, post_type
  2. FROM $wpdb->posts a
  3. WHERE post_status='publish' AND post_type='post'
  4. AND NOT EXISTS(SELECT 1 FROM $wpdb->postmeta b WHERE b.post_id=a.ID AND b.meta_key = 'ImageURL')";

URL: pokrovskii.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.