WordPress.org

Ready to get started?Download WordPress

Forums

get_posts attachments exclude images under specific width (2 posts)

  1. bitesizemunchy
    Member
    Posted 1 year 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.
    http://www.stickerstork.com/portfolio/rook/

    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
    Member
    Posted 11 months 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