pull data from wordpress database
The following should do the trick: global $wpdb ; // get the post_ids from the custom table $sql = “SELECT listing_id FROM {$wpdb->prefix}wpdbdp_listing_fees WHERE fee_id = %d” ; $sql = $wpdb->prepare ($sql, 4) ; $post_ids = $wpdb->get_col ($sql) ; // get the custom posts from the posts table $args = array ( ‘post__in’ => $post_ids, … Read more