PHP-kod:
$getads = mysql_query("SELECT wi1_posts.post_title, wi1_posts.post_content, wi1_posts.post_date, wi1_postmeta.meta_value, wi1_postmeta.meta_key
FROM wi1_posts
INNER JOIN wi1_postmeta
ON wi1_posts.ID=wi1_postmeta.post_id
WHERE wi1_posts.post_status='publish' AND wi1_posts.post_type='ad_listing' AND wi1_postmeta.meta_key='_wp_attached_file'
ORDER BY wi1_posts.post_date DESC LIMIT 5") or die(mysql_error());
Inte provat men tror att det fungerar.