Posted By

Mat_ on 09/13/10


Tagged

post wordpress taxonomy custom-field


Versions (?)

Retreive post from custom field value


 / Published in: PHP
 

  1. <?php
  2.  
  3. $querystr = "
  4. SELECT wposts.*
  5. FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
  6. WHERE wposts.ID = wpostmeta.post_id
  7. AND wpostmeta.meta_key = 'tag'
  8. AND wpostmeta.meta_value = 'email'
  9. AND wposts.post_status = 'publish'
  10. AND wposts.post_type = 'post'
  11. ORDER BY wposts.post_date DESC
  12. ";
  13.  
  14. $pageposts = $wpdb->get_results($querystr, OBJECT);
  15.  
  16. ?>

Report this snippet  

You need to login to post a comment.