get_posts attachments exclude images under specific width (2 posts)

  1. bitesizemunchy
    Posted 3 years ago #

    Here is the code I'm using to call the attached images of a post to show as an image slider:

    $attachments = get_posts(array(
    					'post_type' => 'attachment',
    					'numberposts' => -1,
    					'post_status' => null,
    					'post_parent' => get_the_ID(),
    					'order' => 'ASC',
    					'orderby' => 'rand',

    However, as you can see with the link below, I only want to show the larger images that I upload to be use as the slider images - not the smaller logo image and image used in the content section.

    How can I add an attribute that will only use attachment images with a width larger than 1000px?

    Thanks in advanced for your help!

  2. fukr
    Posted 2 years ago #

    Did you get the answer?
    I am also facing this problem..

Topic Closed

This topic has been closed to new replies.

About this Topic