'attachment', 'numberposts' => - 1, 'post_status' => null, 'post_parent' => null, ); $attachments = get_posts( $args ); if ( $attachments ) { echo '
'; echo '
'; echo ''; echo '
'; } }