1

I use Easy Digital Downloads plugin and I wish to get images from the downloads posts types! But with my code, nothing return! Someone for help?

<?php
$attachments = get_posts( array(
'post_type'   => 'attachment',
'orderby' => 'menu_order',
'numberposts' => 5,
'post_status' => null,
'post_parent' => $post->ID,
'post_mime_type' => 'image'
));

if ( $attachments ) {
foreach ( $attachments as $attachment ) {
echo wp_get_attachment_image( $attachment->ID, 'item' );
}
}
?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.