Hi,
I have the following code...
$args = array(
'post_type' => 'attachment',
'numberposts' => 10,
'post_status' => null,
'post_parent' => null, // any parent
'post_mime_type' => 'image',
'orderby' => 'rand',
);
return get_posts($args);
This code returns 10 random images. I would like to make it ignore the images that doesn't have a parent (which is equal to Zero on the database).
Does anyone know how to do this?
Is it possible to use something that would translate into 'post_parent' > 0