Adding and EITHER OR statement in an $args array
-
I am trying to call a list of all IMAGES stored as posts in the WP database. The array below will only show me uploaded jpgs.
If I delete the post_mime_type line I get ALL attachments (but that includes icons, video mp3 etc.)
I want to see only gif, jpg and png attachments returned but can’t seem to find any way to add a conditional element to the array.
$args = array(
‘post_type’ => ‘attachment’,
‘numberposts’ => 20,
‘post_status’ => null,
‘post_parent’ => $page, // Post number
‘post_mime_type’ => ‘image/jpeg’, //Need to add an OR statement ???
‘order’ => ‘DESC’,
);
$attachments = get_posts($args);Please can someone help me!
The topic ‘Adding and EITHER OR statement in an $args array’ is closed to new replies.