Return to Snippet

Revision: 31771
at September 13, 2010 01:45 by Mat_


Initial Code
<?php

 $querystr = "
    SELECT wposts.* 
    FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
    WHERE wposts.ID = wpostmeta.post_id 
    AND wpostmeta.meta_key = 'tag' 
    AND wpostmeta.meta_value = 'email' 
    AND wposts.post_status = 'publish' 
    AND wposts.post_type = 'post' 
    ORDER BY wposts.post_date DESC
 ";

 $pageposts = $wpdb->get_results($querystr, OBJECT);
 
?>

Initial URL

                                

Initial Description

                                

Initial Title
Retreive post from custom field value

Initial Tags
post, wordpress

Initial Language
PHP