• Resolved swcomm

    (@swcomm)


    Having some difficulty using the shortcode to grab random media gallery images from a page (post_parent), which makes me think that perhaps the attachment post type can’t be queried? My shortcode ends up empty. Advice appreciated – thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    Hi swcomm,

    The Display Posts shortcode has a default setting of 'post_status' => 'publish' so it only shows published content, but attachments don’t use this post status, they use inherit as the post status.

    Try using this shortcode instead:

    [display-posts post_type="attachment" post_status="inherit" post_parent="123"]
    Thread Starter swcomm

    (@swcomm)

    Well, that attachment post status tip is useful! Yep, that does it, thanks so much.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Post Type=Attachment’ is closed to new replies.